+ -
当前位置:首页 → 问答吧 → Python3.2 tkinter使用

Python3.2 tkinter使用

时间:2011-07-26

来源:互联网

[code=Python][/code]
#!/usr/bin/env python
import tkinter
  
top=tkinter.TK()
lable=tkinter.Label(top,text='hello,world')
label.pack()
tkinter.mainloop()
使用的是Python3.2 是因为版本不兼容哪出错了吗,运行时报错:
  File "D:\eclipse\python\helloworld\src\test\e.py", line 4, in <module>
  top=tkinter.TK()
AttributeError: 'module' object has no attribute 'TK'

作者: belindalong   发布时间: 2011-07-26

是不是3.2中已经把该方法去掉了,你help('tkinter')看看有TK这个方法吗?

作者: kyzy_yy_pm   发布时间: 2011-07-26