Python tkinter import error

前端 未结 1 1354
庸人自扰
庸人自扰 2020-12-22 14:09
from tkinter import *
from tkinter import messagebox

root= Tk()
root.mainloop()

Error:

...Traceback (most recent call last)

相关标签:
1条回答
  • 2020-12-22 14:31

    You named your file tkinter.py, so when you import tkinter, it's importing that file rather than the real tkinter module.

    Rename your file to just about anything else.

    0 讨论(0)
提交回复
热议问题