Anyway to use file masks with os.listdir()?

Fredrik Lundh fredrik at pythonware.com
Tue Nov 16 11:33:46 EST 1999


Aaron J Reichow <reic0024 at ub.d.umn.edu> wrote:
> Is there any way to pass a filemask to os.listdir()?  For example, to list
> only files with the extension .jpg.  Any help would be appreciated! :)

it's spelled "glob":

http://www.python.org/doc/current/lib/module-glob.html

</F>

<!-- (the eff-bot guide to) the standard python library:
http://www.pythonware.com/people/fredrik/librarybook.htm
(news: just posted an errata for the 'first printing') -->





More information about the Python-list mailing list