Path ... where is my application's home dir?

Sridhar R sridharinfinity at yahoo.com
Mon May 3 06:11:20 EDT 2004


Marco Aschwanden <PPNTWIMBXFFC at spammotel.com> wrote in message news:<mailman.82.1083164863.25742.python-list at python.org>...
> On Wed, 28 Apr 2004 14:44:30 +0100, Tim Golden 
> <tim.golden at viacom-outdoor.co.uk> wrote:

> But I still wonder: Suppose sys.argv[0] wouldn't work. What would be the 
> easiest way to find out where an application lies?

  Yes.  See `__file__` attribute of your application module.  Also
have a look at the module `inspect`.

> 
> Ideas:
> 1. going through sys.path and checking whether the application file is in 
> a dir
> 2. or is there a module method, that tells you where it is stored?
> 
> Thanks for "help",
> Marco

 BTW, don't forget distutils.



More information about the Python-list mailing list