newb question: file searching

infidel saint.infidel at gmail.com
Tue Aug 8 18:47:37 EDT 2006


> Also, I've noticed that files are being found within hidden
> directories.  I'd like to exclude hidden directories from the walk, or
> at least not add anything within them.  Any advice?

The second item in the tuple yielded by os.walk() is a list of
subdirectories inside the directory indicated by the first item in the
tuple.  You can remove values from this list at runtime to have os.walk
skip over them.




More information about the Python-list mailing list