Possible Duplicate:
How to get/set logical directory path in python
I have a Python script that I run from a symlinked directory, and I call os.getcwd() in it, expecting to get the symlinked path I ran it from. Instead it gives me the "real" path, and in this case that's not helpful. I need it to actually give me the symlinked version.
Does Python have a command for that?
PWD
environment variable isn't updated byos.chdir()
, so it can be inconsistent withos.getcwd()
even when there are no symlinks at all. – Haroun