且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python Tkinter 模块未显示输出

更新时间:2023-02-22 15:41:03

将此添加到您的代码中 root.mainloop(), 这是一个教程.

Add this to your code root.mainloop(), Here's a tutorial.

回应您的评论

#Also note that `from <module> import *` is generally frowned upon
#since it can lead to namespace collisions. It's much better to only
#explicitly import the things you need.
from Tkinter import Tk, Label
root = Tk()
w = Label(root, text="Hello, world!")
w.pack()
root.mainloop()