Python on Max osx and tkinter

Russell E. Owen no at spam.invalid
Fri Dec 26 18:25:40 EST 2003


In article <bsedqg$rf$00$1 at news.t-online.com>,
 Ralf Wieseler <r.wieseler at t-online.de> wrote:

>Hello! I'm quite new to Python.
>
>I wrote some little scripts using the "import from tkinter" Statemant 
>that work well on Windows and Linux. but if i try to execute them in my 
>Powerbook with Mac OSX 10.2.8 i get only Errors. I imorted the TKinter 
>Module with the Package Manager of MacPython 2.3 but it doesn't work.
>My Macphython has no idea of TKinter.
>Whats wrong?

What I did that worked on Jaguar:
- Installed MacPython 2.3 for Jaguar using the binary installer from: 
<http://homepages.cwi.nl/~jack/macpython/macpython-osx.html>
- Installed Tcl/Tk 8.4.4 using the binary installer from 
<http://www.maths.mq.edu.au/~steffen/tcltk/TclTkAqua/>
- Used Package Manager (in /Applications/MacPython) to install _tkinter 
(and also readlines and some other useful stuff)

At that point you ought to be able to open a NEW terminal window (tcsh 
caches some info, so an existing window will probably NOT work) and type 
"pythonw" (not "python", that would result in a GUI you cannot bring to 
the front) and you're in business:

import Tkinter
root = Tkinter.Tk()

should bring up a window. (By the way "import from tkinter" will not 
work. The T in Tkinter is capitalized, and I don't think "import from 
<package>" is valid python.

If that does not work for you, can you be more specific about how it 
fails?



-- Russell

P.S. for Panther, you can use the same technique, but make sure you 
install MacPython 2.3 for Panther instead of for Jaguar, or you'll end 
up with a mess. Panther already includes a usable MacPython (and two 
copies do not coexist well), so the MacPython installer only adds some 
extra components.




More information about the Python-list mailing list