from tkinter import *
root = Tk()
#creating a label widget
myLabel = Label(root, text="Module selection")
#displaying it on the screen
myLabel.pack()
root.mainLoop()
所以我只是看这个非常简单的tkinter教程视频https://www.youtube.com/watch?v=YXPyB4XeYLA
,并且我已经收到此错误。我完全按照他的步骤。该代码是否过期?
答案 0 :(得分:1)
您刚刚将骆驼皮用于mainloop()
from tkinter import *
root = Tk()
#creating a label widget
myLabel = Label(root, text="Module selection")
#displaying it on the screen
myLabel.pack()
root.mainloop()