How to separate directory list and file list?

Peter Hansen peter at
Sun Oct 23 18:23:14 CEST 2005

Gonnasi wrote:
> With
> or
> I can get a combined file list with directory list, but I just wanna a
> bare file list, no directory list. How to get it?

Using Jason Orendorff's path module, it's just this:

 >>> from path import path
 >>> path('.').files()  # returns list of files in current dir


More information about the Python-list mailing list