[melbourne-pug] os.walk into a skip
Mike Dewhirst
miked at dewhirst.com.au
Wed Mar 3 06:40:19 CET 2010
On 3/03/2010 4:18pm, Tobias Sargeant wrote:
>
> On 03/03/2010, at 4:09 PM, Mike Dewhirst wrote:
>
>> Hi all
>>
>> Can someone tell me how to skip some arbitrary directories in os.walk()?
>
>
> from the os.walk() docstring:
>
> When topdown is true, the caller can modify the dirnames list in-place
> (e.g., via del or slice assignment), and walk will only recurse into the
> subdirectories whose names remain in dirnames; this can be used to prune
> the search, or to impose a specific order of visiting. Modifying
> dirnames when topdown is false is ineffective, since the directories in
> dirnames have already been generated by the time dirnames itself is
> generated.
Duh ...
Thanks. I had (must have!) seen that but I was solving a different
problem at the time so it didn't take.
Cheers
Mike
>
> _______________________________________________
> melbourne-pug mailing list
> melbourne-pug at python.org
> http://mail.python.org/mailman/listinfo/melbourne-pug
>
>
More information about the melbourne-pug
mailing list