Re: what's the command for (cd ..) in python

2011-09-10 Thread Cameron Simpson
On 10Sep2011 15:57, Waldek M. wrote: | On Sat, 10 Sep 2011 21:11:32 +1000, Steven D'Aprano wrote: | > The main one that comes to mind is os.walk, which has this to say: | > | > Caution: if you pass a relative pathname for top, don't change the | > current working directory between resump

Re: what's the command for (cd ..) in python

2011-09-10 Thread Waldek M.
On Sat, 10 Sep 2011 21:11:32 +1000, Steven D'Aprano wrote: > The main one that comes to mind is os.walk, which has this to say: > > Caution: if you pass a relative pathname for top, don't change the > current working directory between resumptions of walk. walk never > changes the cur

Re: what's the command for (cd ..) in python

2011-09-10 Thread Steven D'Aprano
Waldek M. wrote: > On Fri, 09 Sep 2011 23:03:10 +1000, Steven D'Aprano wrote: >> 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 fi

Re: what's the command for (cd ..) in python

2011-09-10 Thread Waldek M.
On Fri, 09 Sep 2011 23:03:10 +1000, Steven D'Aprano wrote: > 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

Re: what's the command for (cd ..) in python

2011-09-09 Thread Littlefield, Tyler
On 9/9/2011 6:07 AM, kaustubh joshi wrote: Hello friends, How do we carry out the command "*cd ..*" in python? os.chdir, like so: >>> os.getcwd() '/home/tyler' >>> os.chdir("../") >>> os.getcwd() '/home' So you could do something like: os.chdir("../foo") My problem

Re: what's the command for (cd ..) in python

2011-09-09 Thread Terry Reedy
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

Re: what's the command for (cd ..) in python

2011-09-09 Thread Steven D'Aprano
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

Re: what's the command for (cd ..) in python

2011-09-09 Thread Vlastimil Brom
2011/9/9 kaustubh joshi : > Hello friends, > How do we carry out the command "cd .." in python? > > My problem is : > I have a set of folders say m=1,2,3,4. In each of these folders, I have > subfolders with common name say m_5,m_6,m_7,m_8. In each of these subfolder, > the

what's the command for (cd ..) in python

2011-09-09 Thread kaustubh joshi
Hello friends, How do we carry out the command "*cd ..*" in python? My problem is : I have a set of folders say m=1,2,3,4. In each of these folders, I have subfolders with common name say m_5,m_6,m_7,m_8. In each of these subfolder, there is a file which I have edit.