【发布时间】:2020-05-12 21:38:55
【问题描述】:
def Poland():
import turtle as t
t.bgcolor("black")
t.width(10)
t.color("white")
t.forward(50)
t.right(90)
t.penup()
t.forward(10)
t.right(90)
t.pendown()
t.color("red")
t.forward(50)
Z = eval(input("Your country: "))
if (Z == Poland):
Poland()
当我运行这个程序并用波兰回答“你的国家”问题时,它确实有效(它打开了“Python Turtle Graphics”窗口并绘制了一个标志),但它被最小化了。请帮忙。我是新手。
【问题讨论】:
-
不相关,但为什么是
eval(input(..))? (您知道这样可以擦除硬盘吗?) -
它在任务栏中(最小化) 示例:当您打开谷歌并单击右上角的“-”时,它会将您带到桌面并在任务栏中保持打开状态。
-
我可以用什么来代替它?
-
我可以用什么代替 eval(input(...))
-
更好的教程,更现代的 Python 版本,或者,如果一切都失败了,请阅读 the official documentation。