Con*_*ews 2 python tkinter attributeerror
在我的 python 代码中,该root.mainloop()行导致错误:
AttributeError: '_tkinter.tkapp' object has no attribute 'mainLoop'
我在 Mac 上,我的代码是:
from tkinter import *
root = Tk()
myLabel1 = Label(root, text = 'My First GUI')
myLabel1.pack()
root.mainLoop()
Run Code Online (Sandbox Code Playgroud)
你应该更换:
root.mainLoop()
Run Code Online (Sandbox Code Playgroud)
和
root.mainloop()
Run Code Online (Sandbox Code Playgroud)
全部为小写字母。
| 归档时间: |
|
| 查看次数: |
2328 次 |
| 最近记录: |