Getting all the *files* from a directory -- A better way??

Scottie me at nospam.net
Fri Mar 30 14:37:19 EST 2001


"Ken Seehof" <kens at sightreader.com> wrote in message
news:mailman.985740096.16937.python-list at python.org...
>... e.g.:
> f = os.path.join(root, 'doc/chapter2/spam.html')
> rather than
> f = os.path.join(root, os.path.join('doc', os.path.join('chapter2',
> 'spam.html'))))
>

I just thought I'd remind you:
   f = os.path.join(root, 'doc', 'chapter2', 'spam.html')
works as well.  It is easy to forget join is a multi-arg function.

-Scott David Daniels






More information about the Python-list mailing list