[Pythonmac-SIG] Difference between pythonw and python?

Jack Jansen Jack.Jansen at cwi.nl
Thu Apr 1 06:51:16 EST 2004


On 1-apr-04, at 9:06, Jens Miltner wrote:
>>
>> Then it could be you're running up against a completely different 
>> problem. Does the hosting application have its own GUI mainloop? 
>> Because if it has (and note it could be implicit, if you use Cocoa or 
>> CarbonEvents)  then you will probably run into problems with your 
>> mainloop and Tk's mainloop getting in each others hair.
>
> Yes, but I don't even get that far - python raises an exception that 
> Tk is not a known symbol, even though the script imported * from 
> Tkinter...
> Strangely, the python scripts run fine when launched from the 
> commandline, but when executed using PyRun_SimpleString from within 
> our app, I get an error "NameError: name 'Tk' is not defined" when 
> trying to instantiate Tk(), even though the "from Tkinter import *" 
> statement did pass successfully...

Ah, you are indeed running into a completely different problem. I think 
there's something wrong with your sys.path, or the _tkinter.so module 
didn't load correctly for some reason, or something like that.

Try running with the environment variable PYTHONVERBOSE set, both the 
command line and embedded version, and see whether there are any 
differences in what is imported from where.
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman




More information about the Pythonmac-SIG mailing list