using os

Jeffrey Froman jeffrey at fro.man
Mon Nov 29 16:43:10 EST 2004


Juliano Freitas wrote:

> how can i get just the directories in other directorie without a files
> using the os module in Python??

You can test using os.path.isdir, for example:

>>> import os
>>> [x for x in os.listdir('.') if os.path.isdir(x)]          


   Jeffrey



More information about the Python-list mailing list