On 9/9/2011 9:03 AM, Steven D'Aprano wrote:
kaustubh joshi wrote:

Hello friends,
                          How do we carry out the command "*cd ..*" in
python?

import os
os.chdir('..')

But think carefully before doing this. Some functions may be confused if you
change directories while they are running. You may be better off staying in
the same directory, and adjusting the path names to the files as you work
with them.

Or, use it once at the top of the main module, with an absolute path, to make sure you start at a known place where you want to start.

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to