from Tkinter import *
root = Tk()
root.mainloop()
运行出现错误:
>>>
Traceback (most recent call last):
File "E:/××××/Python/test",line 1,in <module>
from Tkinter import *
ImportError: No module named Tkinter
改为以下代码即可(Python 3.1,3.2):
from tkinter import *
root = Tk()
root.mainloop()
原文链接:https://www.f2er.com/python/526813.html