Breaking out of walk()
Fredrik Lundh
fredrik at pythonware.com
Sun Jan 16 14:44:31 EST 2000
More information about the Python-list mailing list
Sun Jan 16 14:44:31 EST 2000
- Previous message (by thread): Breaking out of walk()
- Next message (by thread): Breaking out of walk()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Gerrit Holl <gerrit.holl at pobox.com> wrote: > Robert Roy wrote on 948036970: > > if 'cvs' in names: names.remove('cvs') > > > > will skip over directories named 'cvs' > > It won't: > >>> l = ['foo', 'cvs', 'bar', 'cvs'] > >>> l.remove('cvs') > >>> l > ['foo', 'bar', 'cvs'] it will -- when the walk callback is called, the "names" argument only contains the files and subdirectories directly under "dirname"... (if os.listdir returns duplicates on your computer, you should fix your operating system) </F>
- Previous message (by thread): Breaking out of walk()
- Next message (by thread): Breaking out of walk()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list