Python on Max osx and tkinter

Ralf Wieseler r.wieseler at t-online.de
Wed Dec 31 11:03:23 CET 2003


Russell E. Owen schrieb:
> 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.
Thanks for your great help. That explains a lot of my troubles with 
MacPython. a very useful statement. It realy should be on the MacPython 
Webside cause i guess there are many people "fighting" with Tkinter and 
MacPython!!
I'm really happy now!!





More information about the Python-list mailing list