G
gmax2006
Hi,
I use RedHat linux.
How can I find where exactly the current python script is running?
I use this code:
#test.py
import os,sys
print sys.argv
os.chdir(os.path.dirname(sys.argv[0]))
It doesn't work when I run this command from the directory that
test.py is located:
python test.py
That means sys.argv[0] doesn't always contain the full path of
running script.
Any help would be appreciated,
Max
I use RedHat linux.
How can I find where exactly the current python script is running?
I use this code:
#test.py
import os,sys
print sys.argv
os.chdir(os.path.dirname(sys.argv[0]))
It doesn't work when I run this command from the directory that
test.py is located:
python test.py
That means sys.argv[0] doesn't always contain the full path of
running script.
Any help would be appreciated,
Max