Persistent Directory Change?

Dave Butler davebutlerREMOVE at hotmail.com
Fri May 31 09:48:36 EDT 2002


I have a need for the current directory from a Python script to persist
after the script ends. Is this possible? A simple approach such as

--------------------
import os

print os.getcwd()
os.chdir(r'f:\temp')
print os.getcwd()
--------------------

does not work. It seems the directory change occurs in the Python process,
but not in the command prompt which called it.

I am using Python 2.1 under Windows 2000.

Any suggestions for accomplishing this?

Dave





More information about the Python-list mailing list