Linux application deployment

David Bolen db3l at fitlinxx.com
Mon Sep 6 14:16:36 EDT 2004


"Robert Brewer" <fumanchu at amor.org> writes:

> Shorter version for the local directory:
> 
> import os.path
> localDir = os.path.dirname(__file__)

Note that __file__ isn't set for top level scripts prior to Python
2.3, so if you need to support older versions you may want to try the
__file__ access and fall back to argv[0] if its not available.

-- David



More information about the Python-list mailing list