Tkinter是Python的GUI widget。
一般情况下Linux都没有自带,要自己安装。
1、确定Tkinter没有安装:
zhancang@debian:~$ python
Python 2.4.4 (#2, Apr 5 2007, 20:11:18)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
Traceback (most recent call last):
File "", line 1, in ?
File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 41, in ?
raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: No module named _tkinter, please install the python-tk package
>>>
2、安装Tkinter:
zhancang@debian:~$ su -
Password:
debian:~# aptitude install python-tk
Reading package lists... Done
Building dependency t