🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.python
Article #27599

Re: rekursywne listowanie katalogu

#27599
From: marrgol
Date: Mon, 26 Jul 2010 02:21
14 lines
1534 bytes
On 2010-07-26 01:01, Michal wrote:
> Czy w pythonie jest jakas funkcja, ktora wylistuje mi katalog rekursywnie?
> Wiem o funkcji os.walk 

os.walk zwraca wszystko, co trzeba, a wylistować chyba można samemu,
w formie w jakiej się potrzebuje? ;-)  Np. tak:

for path, dirs, files in os.walk('katalog'):
    print path + '/'
    for file in files:
        print path + '/' + file

-- 
mrg
Technical Details
Message-ID: <4c4cf132$0$2587$65785112@news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
References: <20100726010149.92ae9f6d.natural-born-killer@donotmail.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!news.nask.pl!news.nask.org.pl!newsfeed00.sul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!unt-spo-a-02.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
Date: Mon, 26 Jul 2010 04:21:38 +0200
From: marrgol <marspamrgol@gspammail.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100520 x/3.0.5 Thunderbird/3.0.5
MIME-Version: 1.0
Newsgroups: pl.comp.lang.python
Subject: Re: rekursywne listowanie katalogu
References: <20100726010149.92ae9f6d.natural-born-killer@donotmail.me>
In-Reply-To: <20100726010149.92ae9f6d.natural-born-killer@donotmail.me>
Lines: 14
Message-ID: <4c4cf132$0$2587$65785112@news.neostrada.pl>
Organization: Telekomunikacja Polska
NNTP-Posting-Host: 80.54.82.172
X-Trace: 1280110898 unt-rea-a-02.news.neostrada.pl 2587 80.54.82.172:38160
X-Complaints-To: abuse@news.neostrada.pl
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit