sys.argv - Returns path and filename.
gustav at morpheus.demon.co.uk
Thu Jun 27 15:29:08 CEST 2002
"Mark McEahern" <marklists at mceahern.com> writes:
>> How do I get the current path of the script I am running, on the mac
>> osx and the linux box ? (Any work around would be great, I don't want
>> to have to hardcode the path into the script, or even give the path as
>> an argument,I want the script to know where it is.)
> import os
> print os.getcwd()
Run this before you change directory...
More information about the Python-list