The Python 2.3.3 Windows Installer includes Tcl/Tk as well as Tkinter. This is essentially a one-click install of everything needed.
On the Mac, the OS9 Python installer includes Tcl/Tk and Tkinter. However, Python releases after 2.3.x will not support OS9. On 18 March 2004, Tcl maintainers removed "most (if not all) of the MacOS-classic-specific stuff ... from the Tcl [8.5] CVS source tree." Previously, Jack Jansen removed the OS9 support from the Python 2.4 CVS.
OS X 10.2/10.3 comes with Python 2.3. Tkinter and IDLE are easily loaded using the MacPython package manager. The package manager doesn't handle Tcl/Tk/Aqua, which must be installed separately. Refer to the Mac page on the Python website and the MacPython website. [The differences between the latter two webpages need to be resolved. --KBK]
Linux and the *BSD platforms require a separate installation of Tcl/Tk. This is usually available as a binary package.
Ubuntu / Debian (?)
sudo apt-get install python python-tk idle python-pmw python-imaging
(This installs Python, Tkinter [not really needed since it automatically gets installed with Python], IDLE, Python MegaWidgets, and PIL.)
Fedora Core 3
yum install tkinter
(This will install Python 2.3.4, Tk 8.4.7, and Tix 8.1.4, plus supporting packages, if necessary).
You can install the "idle" editor (which uses Tkinter) with
yum install python-tools
There does not seem to be a version of PIL included with Fedora Core 3.
Fedora Core 2
yum install tkinter
(This will install Python 2.3.3, Tk 8.4.5 and Tix 8.1.4, plus supporting packages, if necessary).
Fedora Core 1
yum install tkinter
(this will install Python 2.2.3, Tk 8.3 and Tix 8.1.4, plus supporting packages, if necessary). You may also want to
yum install python-imaging
to get the ImageTk module from the [http://www.pythonware.com/products/pil/index.htm PIL] library.
RedHat Linux 9
RH9 comes with Python 2.2.2 and Tcl/Tk/Tkinter. There are memory leaks in the RH implementation. Upgrading to Python 2.3 is problematic because of changes RH made to the code. For information on how to do it, follow this discussion on python-list.
ActivePython provides an easily-installable form of Python for Linux, Windows, and Solaris (and other operating systems, for those willing to pay). Note that this is not FOSS; only authorized modifications can be redistributed.
Windows Mobile 2003
There's a distribution of Python 2.3.4. that includes Tkinter available from the Python CE project on Sourceforge. The following may work for you:
- put the Python-2.3.4-arm-PPC2003.zip file into \\Program Files\\Python and unzip it. Note that the file python23.zip should remain zipped.
put the file Tkinter-Files.zip into \\My Documents and unzip. Copy the Windows folder to your root folder so that its contents go into the Windows folder. You can't just select the contents of that folder because File Explorer won't show you the hidden .dll files inside it. Next, open the tcl8.4 folder and copy the two subfolders inside it (library and tk8.4) to \\Program Files\\Python. You should now have the two of them there plus a Lib folder.
- Go into the the \\Program Files\\Python\\Lib folder and run the Setup Registry batch file. If all goes well, it will run without error; you can now double-click on a .py file and it will run. If it provides an error, run the python executable and see what errors it provides. Note that if an error window pops up, it may be obscuring another more informative window behind it, so use your window manager to get to it.
- Add a path to your Tkinter library in any programs you use with this command:
Get an editor program (like Tillanosoft's Notepad) and start coding. Below is a sample app that ran on a HP2215.
Follow the Python-CE mailing list, readable at Gmane.org
1 #HelloWorld.py 2 import sys 3 sys.path.append('\\Program Files\\Python\\Lib\\python23.zip\\lib-tk') 4 import Tkinter 5 root = Tkinter.Tk() 6 l = Tkinter.Label(root, text="Hello, world!\nTkinter on PocketPC!\nSee http://pythonce.sf.net.") 7 b = Tkinter.Button(root, text='Quit', command=root.destroy) 8 l.pack() 9 b.pack() 10 root.mainloop() 11
Screenshot of Tkinter on Windows CE: