py2exe windows apps path question

Gregory Piñero gregpinero at gmail.com
Tue Aug 2 14:55:18 EDT 2005


> If you need something that works both on a frozen app as well as an
> (unfrozen) python
> script, you'd be better off using something like:
> 
> def getAppPrefix():
>     """Return the location the app is running from
>     """
>     isFrozen = False
>     try:
>         isFrozen = sys.frozen
>     except AttributeError:
>         pass
>     if isFrozen:
>         appPrefix = os.path.split(sys.executable)[0]
>     else:
>         appPrefix = os.path.split(os.path.abspath(sys.argv[0]))[0]
>     return appPrefix
> 

Vincent,

This sounds interesting.  A few questions for you:
Why don't I see sys.frozen in interpreter?  
Does it only appear when it is frozen?  
What do you mean by frozen, how does python know?
What does sys.executable do?

Thanks,

Greg



More information about the Python-list mailing list