[Pythonmac-SIG] pythonw and python with applescript
bob at redivi.com
Tue Dec 13 21:34:21 CET 2005
On Dec 13, 2005, at 12:18 PM, Zhi Peng wrote:
> If we use pythonw, then there may be problem in C code to call the
> python code with appscript inside because it seems
> PyImport_ImportModule("ModuleName") only works with python instead
> of pythonw.
pythonw is just a shell script. You're embedding Python, it's not
even an option. You must use an application bundle in order to
communicate with WindowServer.
You probably shouldn't be embedding Python in the first place.. Much
easier that way, because py2app can create the application bundle for
you, and you don't have to deal with all of the initialization/
finalization for Python.
More information about the Pythonmac-SIG