Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #13020

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

Return-Path <kandrjoshi@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.102
X-Spam-Level *
X-Spam-Evidence '*H*': 0.80; '*S*': 0.00; 'python?': 0.05; 'does.': 0.07; 'script,': 0.07; 'subject:python': 0.11; '.."': 0.16; '8bit%:82': 0.16; 'skip:- 130': 0.16; 'subject:command': 0.16; 'trying': 0.21; 'skip:\xa0 40': 0.23; 'command': 0.24; 'variable': 0.24; 'problem': 0.28; 'message-id:@mail.gmail.com': 0.29; '\xa0\xa0\xa0': 0.31; 'values': 0.32; 'skip:\xa0 30': 0.32; 'it.': 0.33; 'there': 0.33; 'to:addr:python-list': 0.33; 'file.': 0.34; 'stuck': 0.34; 'folder': 0.35; 'file': 0.36; 'created': 0.36; 'using': 0.37; 'run': 0.37; 'but': 0.37; 'something': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'help': 0.39; 'missing': 0.39; 'to:addr:python.org': 0.39; 'subject: (': 0.39; 'carry': 0.62; 'skip:1 10': 0.63; 'designed': 0.65; 'taking': 0.66; '8bit%:93': 0.67; '8bit%:94': 0.69; '8bit%:100': 0.70; '--->': 0.84; 'the\xa0': 0.84; 'received:209.85.218.46': 0.91; 'received:mail-yi0-f46.google.com': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=gcik5Vr3xZdALdeXxHAJ4mDbb9NmVNU1yirJ9qeQSHM=; b=Y0BjYRAn6cXAfOtM4jiOUIveJiSqCBqnIPdATHEvidvywpBy3XIFx8hgDOjMwgvu2i T0c7Ydosyno4bHWndTpZ5TO9wwyZKSc9mniy8kqrSGeklxY6HPXOhVwB9Adq3mLopMu5 u/baMOtgvBT2DI5Mi8SzxiawdRpD/syxYfw+o=
MIME-Version 1.0
Date Fri, 9 Sep 2011 14:07:03 +0200
Subject what's the command for (cd ..) in python
From kaustubh joshi <kandrjoshi@gmail.com>
To python-list@python.org
Content-Type multipart/alternative; boundary=bcaec52155aff4ec4704ac810361
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.903.1315570033.27778.python-list@python.org> (permalink)
Lines 73
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1315570033 news.xs4all.nl 2470 [2001:888:2000:d::a6]:44130
X-Complaints-To abuse@xs4all.nl
Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!feed.ac-versailles.fr!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:13020

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

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.
                                          1
         2                                    3
       4
                                         |
          |                                      |
            |

------------------------------------------------------------------------------------------------------------------------------------------
                                  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

That is how I designed it

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.

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.

I am trying with os.chdir(path), but stuck with how to use m_n in it.

What I am missing at the moment is something that do the job "cd .." does.

Any help


Karan

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

what's the command for (cd ..) in python kaustubh joshi <kandrjoshi@gmail.com> - 2011-09-09 14:07 +0200
  Re: what's the command for (cd ..) in python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-09 23:03 +1000
    Re: what's the command for (cd ..) in python Terry Reedy <tjreedy@udel.edu> - 2011-09-09 13:35 -0400
    Re: what's the command for (cd ..) in python "Waldek M." <wm@localhost.localdomain> - 2011-09-10 12:32 +0200
      Re: what's the command for (cd ..) in python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-10 21:11 +1000
        Re: what's the command for (cd ..) in python "Waldek M." <wm@localhost.localdomain> - 2011-09-10 15:57 +0200
          Re: what's the command for (cd ..) in python Cameron Simpson <cs@zip.com.au> - 2011-09-11 09:50 +1000

csiph-web