代码如下:
#!/usr/bin/python
#filename :
psctk.pyfrom Tkinter import *
root = Tk()
w = Label(root,text = "hello, world!")
w.pack()
root.mainloop()
运行的时候报错所TCL没有安装对:
Traceback (most recent call last):
File "
psctk.py", line 6, in <module>
root = Tk()
File "C:\Python27\lib\lib-tk\
Tkinter.py", line 1745, in __
self.tk = _tkinter.create(screenName, baseName, classNam
objects, useTk, sync, use)
_tkinter.TclError: Can't find a usable init.tcl in the follo
{C:\Python27\tcl\tcl8.5} C:/Python27/lib/tcl8.5 C:/lib/t
C:/library C:/library C:/tcl8.5.9/library C:/tcl8.5.9/librar
C:/Python27/tcl/tcl8.5/init.tcl: version conflict for packag
need exactly 8.5.2
version conflict for package "Tcl": have 8.5.9, need exactly
while executing
"package require -exact Tcl 8.5.2"
(file "C:/Python27/tcl/tcl8.5/init.tcl" line 20)
invoked from within
"source C:/Python27/tcl/tcl8.5/init.tcl"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list source $tclfile]"
This probably means that Tcl wasn't installed properly.
不知道如何调试,请大侠不吝赐教。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/66727
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.