directories problem

Peter Hansen peter at engcorp.com
Tue Sep 14 04:36:10 CEST 2004


Dan Perl wrote:

> I'm not sure whether this is what Lowell is looking for, but I've been 
> looking at a similar problem and I would also like to see a solution for 
> that: can a python script know its own full path name?

See near the end of this thread: 
http://groups.google.ca/groups?threadm=8089854e.0407070426.2fb90f95%40posting.google.com

Also note that scripts other than the main one can do it even more
easily: __file__, or if that's not always an absolute path, 
os.path.abspath(__file__).

-Peter



More information about the Python-list mailing list