Path question

William Park parkw at better.net
Tue May 9 10:21:23 EDT 2000


On Tue, May 09, 2000 at 05:18:22PM +0000, Lars Lundstedt wrote:
> A question:
> 
> When I run as script, is there a way for the script to get the path of the
> file it's in? Some sort of system variable maybe...

What you want are
    sys.argv[0]
    os.environ['PWD']

--William




More information about the Python-list mailing list