[Pythonmac-SIG] possible OT: os.chdir on OSX

Scott Frankel leknarf at pacbell.net
Wed Mar 31 01:34:56 EST 2004


On OSX 10.3

How would one change working directories using a python
script and have the parent process (the shell from which the
script was launched) switch to that directory?

i.e.:
os.chdir("some_other_dir")
print os.getcwd()

this prints "some_other_dir", so I know the script's process
made it there.  But when the script exits, my shell is back to
where I launched the script from.  (In fact, it never left.)

Thanks in advance!
Scott




More information about the Pythonmac-SIG mailing list