Changing a shell's current directory with python

Andy B. abuecker at gmail.com
Sun Dec 18 18:53:11 EST 2005


I've got a python utility that I want to change my shell's current
directory based on criteria it finds.  I've scoured google and the
python cookbook and can't seem to figure out if this is even possible.
 So far, all my attempts have changed the current python session only.
 Am I going to have to wrap this in a shell script?

% pwd
/var/tmp
% myutil.py
# do some stuff and cd to '/var/log'
% pwd
/var/log

Many thanks,

-A



More information about the Python-list mailing list