gpt4 book ai didi

python - 使用 PyCharm 用 turtle (python)绘图

转载 作者:太空狗 更新时间:2023-10-30 01:46:29 31 4
gpt4 key购买 nike

我正在运行最新的 PyCharm Pro 版本并尝试从临时文件运行以下代码,但它似乎不起作用

import turtle

wn = turtle.Screen()
alex = turtle.Turtle()
alex.forward(150)
alex.left(90)
alex.forward(75)

我的意思是不工作,没有窗口弹出,但我确实在输出中看到了

Process finished with exit code 0

任何想法

  1. 如果可以通过 PyCharm 完成
  2. 我在配置方面缺少什么

干杯

最佳答案

我遇到了同样的问题。原来解决方案在“turtle ”模块中。

你想结束

turtle.done()

turtle.exitonclick()

尽情享受吧!

关于python - 使用 PyCharm 用 turtle (python)绘图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26737366/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com