<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 9/9/2011 6:07 AM, kaustubh joshi wrote:
    <blockquote
cite="mid:CAJ02=3jSi2C6qZUbaLmQi70f-XNyuM3ba-Mq1nzSDpXg-ruHQw@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html;
        charset=ISO-8859-1">
      Hello friends,<br>
                               How do we carry out the command "<b>cd ..</b>"
      in python?<br>
      <br>
    </blockquote>
    os.chdir, like so:<br>
    >>> os.getcwd() <br>
    '/home/tyler'<br>
    >>> os.chdir("../") <br>
    >>> os.getcwd() <br>
    '/home' <br>
    So you could do something like: os.chdir("../foo")<br>
    <br>
    <blockquote
cite="mid:CAJ02=3jSi2C6qZUbaLmQi70f-XNyuM3ba-Mq1nzSDpXg-ruHQw@mail.gmail.com"
      type="cite">My problem is :<br>
      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. <br>
                                                1                       
                         2                                    3         
                                 4<br>
                                               |                       
                          |                                     
      |                                      |<br>
                                          
------------------------------------------------------------------------------------------------------------------------------------------<br>
                                        1_5, 1_6, 1_7, 1_8              
      2_5 ,2_6, 2_7, 2_8           3_5, 3_6, 3_7, 3_8          4_5, 4_6,
      4_7, 4_8<br>
      <br>
      That is how I designed it<br>
      <br>
      When I run my script, it follows the route 1 ---> 1_5----->
      do the edit job in the file. Now it need to change the  subfolder
      from 1_5 to 1_6, which is not happening.<br>
      <br>
      I created the folders using variable like m for folder taking
      values 1,2,3,4 and m_n for subfolders with n=5,6,7,8.<br>
      <br>
      I am trying with os.chdir(path), but stuck with how to use m_n in
      it.<br>
      <br>
      What I am missing at the moment is something that do the job "cd
      .." does.<br>
      <br>
      Any help<br>
      <br>
      <br>
      Karan<br>
      <br>
      <br>
      <br>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 

Take care,
Ty
Web: <a class="moz-txt-link-freetext" href="http://tds-solutions.net">http://tds-solutions.net</a>

Sent from my toaster.
</pre>
  </body>
</html>