sys.argv - Returns path and filename.
guy at lightwork.co.uk
Thu Jun 27 14:32:19 CEST 2002
I work on multiple platforms, at the moment, I have python installed
on my win32 box which I mainly work on, a MacOSX box and a linux box
which has a very old version installed on it.
The only major problem that I have come across at the moment is the
argv, on my win32 box it retruns the path and a filename, on the
mac osx and the linux only the filename are returned.
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.)
I've tryed searching for this but can't find it anywhere.
Example script called arguments.py :
Result Win32 :
Result Mac OSX :
MacOSX% python arguments.py
Result Linux :
linux% python arguments.py
More information about the Python-list