Test for plain files

Michael Hudson mwh21 at cam.ac.uk
Fri Oct 15 14:27:44 EDT 1999


u970130 at studbo.hit.no (Thomas Weholt) writes:

> Hi,
> 
> I need to know wether or not a file is a dir or a plain file. I`m
> using os.walk to traverse directory-tree, and want to process only
> plain files. How can I do this or what module can be used? 
> 
> I`ve allready looked into os.stat for info, but is there sort of a
> os.stat.isdir() function available? 

close: os.path.isdir is what you want.
hth,
Michael




More information about the Python-list mailing list