海龟图形窗口打不开

问题描述 投票:0回答:1

我正在尝试使用海龟图形,但无法打开弹出窗口。 我使用的是 Windows 11、python 3.8.10 和 VS-code。

我尝试从 VS 文件以及 Python3 控制台运行海龟屏幕。

VS代码:

import turtle
wn = turtle.Screen()
wn.mainloop() # This was added after trying to find an answer online but didn't help.

Python 控制台:

Python 3.8.10 (default, May 26 2023, 14:05:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import turtle
>>> s = turtle.Screen() 

我在其他问题中看到窗口打开并立即关闭,这不是我的问题。就我而言,它根本打不开。

python python-3.x windows turtle-graphics python-turtle
1个回答
0
投票

您遇到任何错误吗?如果没有,请尝试执行修改屏幕的命令,例如:

wn.bgcolor("white")
© www.soinside.com 2019 - 2024. All rights reserved.