【问题标题】:My program is running, but it is minimized我的程序正在运行,但已最小化
【发布时间】: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

标签: python minimized


【解决方案1】:

如果你想最大化海龟窗口,只需使用:

t.Screen().cv._rootwindow.wm_state("zoomed")

t.Screen().cv._rootwindow.state("zoomed")

这是可行的,因为 turtle 就是 tkinter 窗口。

但是窗口会在后台播放。

在第一层弹出它:

t.Screen().cv._rootwindow.attributes("-topmost", True)

turtle 中的更多 tkinter t.Screen().cv._rootwindow.here_comes_the_tkinter_window_command

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-07
    • 1970-01-01
    • 2011-09-10
    • 1970-01-01
    • 1970-01-01
    • 2020-04-24
    • 1970-01-01
    相关资源
    最近更新 更多