[Pythonmac-SIG] Difference between pythonw and python?

Jens Miltner jum at mac.com
Thu Apr 1 02:06:38 EST 2004


Am 31.03.2004 um 17:39 schrieb Jack Jansen:

>
> On 31 Mar 2004, at 13:55, Jens Miltner wrote:
>>>> Do you happen to know why the /usr/bin/python executable differs 
>>>> from
>>>> the Python.app executable, when both are in the same 
>>>> Python.framework?
>>>> I'd assume that when the framework comes with Panther, there 
>>>> shouldn't
>>>> be two python executables...???
>>>
>>> It has something to do with the executable (aka argv[0]?) being seen
>>> to be in a bundle.  Is your app that embeds Python a bundle?
>
> And actually that is the only difference. /usr/bin/python and 
> ...../Python.app/Contents/MacOS/Python could have the exact same bits.
>>
>> Yes, it's an application package. I link against the Python.framework 
>> (or actually, I load it dynamically - not sure whether that makes a 
>> difference. Maybe I should try to link against Python.framework for 
>> testing purposes...)
>
> 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...

</jum>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2351 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040401/0da62490/smime.bin


More information about the Pythonmac-SIG mailing list