[Tutor] how do I find where my program is installed?

Jeff Peery jeffpeery at yahoo.com
Thu Sep 7 23:28:25 CEST 2006


Thanks Bill, 

I read the link you sent, and I am not sure what they mean by "You cannot rely on __file__, because __file__ is not there in the py2exed main-script." can't I use _file_ in my application though? This is what I just added to my application and it seems to do the trick... is there an exception that I am not aware of?

using your method, what do you do with 'installDir' in py2exe?

thanks for the help. 

billburns at pennswoods.net wrote: 

> way. so I need to tell my program to set the working directory back to the
> installation directory... but where is this?
>

Here's what I do in my py2exe app:

installDir = os.path.dirname(os.path.abspath(sys.argv[0]))

and take a look at this link:

http://www.py2exe.org/index.cgi/WhereAmI

HTH,

Bill


 		
---------------------------------
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060907/1ce4c6ee/attachment.htm 


More information about the Tutor mailing list