James Stroud wrote:
> Sorry, I've never used os.walk and didn't realize that it is a generator.
> 
> This will work for your purposes (and seems pretty fast compared to the 
> alternative):
> 
> file_count = len(os.walk(valid_path).next()[2])

Thanks James... this works *really* well for times when I only need to count 
files in 
the current directory (no recursion). I think others will find it useful as 
well.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to