[Pythonmac-SIG] py2app run errors
Bob Ippolito
bob at redivi.com
Thu Aug 10 22:07:45 CEST 2006
On Aug 10, 2006, at 12:25 PM, William Kyngesburye wrote:
> I have a python script that sets a couple environment vars and runs a
> shell script in a Terminal window. It works when run from a Terminal
> with 'python doshell.py'. But when packaged into an app with py2app
> I get errors.
>
> Here's a simplified version (doshell.py):
>
> #!/usr/bin/env python
>
> import sys
> import os
>
> base = os.path.dirname(sys.argv[0])
This should probably be os.path.dirname(__file__)
> # options used by myshell.sh (can't use args)
> os.environ['STARTBASE'] = base
> os.environ['MYOPTION'] = 'shelloption'
>
> shellrun = base + '/myshell.sh'
>
> os.execlp('open', 'open', '-a', 'Terminal.app', shellrun)
Probably should specify /usr/bin/open instead of just open.
-bob
More information about the Pythonmac-SIG
mailing list