Need a recursion lesson

Dirk-Ulrich Heise hei at adtranzsig.de
Wed Dec 22 10:34:17 EST 1999


>"Eide" <nickliz at t-online.de> writes:
>
>> Hello,
>> I would like to do a search for file types, and I figure a good way to do
it
>> would be with recursion...  compare a sliced 'file[:-6]' of each item in
>> list from a directory.  And if there is another directory in that list to
do
>> a listdir on it and .... My head is spinning already.
>> I have no clue what I'm doing. Does anyone have any pointers to about how
to
>> walk through something like this? Any help would be a lot.

os.path.walk() should do the recursion for you. Grep for "walk" in Lib/*.py
of your Python tree.

--
Dipl.Inform. Dirk-Ulrich Heise
hei at adtranzsig.de
dheise at debitel.net






More information about the Python-list mailing list