[Pythonmac-SIG] Getting the location of an applet under OSX
Rob Bedford
rafferty29 at mchsi.com
Sat Aug 23 18:39:02 EDT 2003
So if you have the path to the .py which is in a known place just
delete the proper amout of directories. In other words
os.chdir(os.path.dirname(sys.argv[0])) which will put you at the .py
then os.chdir("..") for each level you need to go up.
Rob
On Thursday, August 21, 2003, at 02:33 PM, Vince Tagle wrote:
> Hello,
>
> I have a python script that I saved as an applet (running OSX here)
> and I'm
> trying to get the path to the applet but nothing I've tried has worked
> so
> far. Is what I'm trying to do even possible? os.getcwd() always
> returns the
> path to the root and sys.argv[0] returns the path to the .py module
> buried
> within the package of the applet.
>
>
> Vince
> no .sig today
>
>
>
> _______________________________________________
> Pythonmac-SIG maillist - Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>
More information about the Pythonmac-SIG
mailing list