navigating/changing directories

Kartic kartic.krishnamurthy at gmail.com
Thu Jan 6 13:10:45 CET 2005


> /this/directory when I exit the script.  Is it possible to have a
script
> 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.
Thanks,
--Kartic




More information about the Python-list mailing list