Recursing into directories

Gerhard Häring gh_pythonlist at
Mon Dec 10 13:00:28 EST 2001

Le 10/12/01 à 17:22, Ron écrivit:
> Hi,
> Is there a built-in class (in dircache, os.path????) that 
> recurses thru a directory tree?
> I've written one using dircache.listdir, but if there is some-
> thing pre-written, I'd rather use that...

Only a function: os.path.walk

And because I usually want a class, too, I didn't find it especially

mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))

More information about the Python-list mailing list