navigating/changing directories

Kartic kartic.krishnamurthy at
Thu Jan 6 07:10:45 EST 2005

> /this/directory when I exit the script.  Is it possible to have a
> that can drop me off into a different directory than where I
initiated it
> from?

Use os.chdir(newpath)

So, you can code os.chdir(r'/a/totally/different/directory') and find
yourself in /a/totally/different/directory after the script completes.

More information about the Python-list mailing list