How to avoid certain directories when using os.walk?

Peng Yu pengyu.ut at
Fri Oct 30 05:53:31 CET 2009

I don't see a way to avoid walking over directories of certain names
with os.walk. For example, I don't want os.walk return files whose
path include '/backup/'. Is there a way to do so? Otherwise, maybe I
will have to make my own program. Thank you!

More information about the Python-list mailing list