> for t in os.walk(somedir): > t[1][:]=set(t[1])-{'.svn','tmp'} > ... do something > > This is a very clever hack but... it relies on internal implementation > of os.walk.... This doesn't appear to be an internal implementation detail; this is documented behavior. http://docs.python.org/dev/library/os.html#os.walk shows a similar example: for root, dirs, files in os.walk('python/Lib/email'): # ... dirs.remove('CVS') # don't visit CVS directories -- Michael Urman
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4