[Pythonmac-SIG] possible OT: os.chdir on OSX
Scott Frankel
leknarf at pacbell.net
Wed Mar 31 02:44:04 EST 2004
OK, then. Thanks.
Scott
On Mar 30, 2004, at 11:32 PM, Jens Miltner wrote:
>
> Am 31.03.2004 um 08:34 schrieb Scott Frankel:
>
>>
>> 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.)
>
> There's no way to ever change the working directory in the calling
> shell, since that's another process and - fortunately - one process
> can't change another process' runtime environment!
>
> </jum>
>
More information about the Pythonmac-SIG
mailing list