how to search directories under <PATH>

Larry Bates lbates at swamisoft.com
Sat Jun 26 09:21:25 EDT 2004


os.path.exists() is what you want.

Secondly,  If you want to traverse path
hierarchy use os.path.walk().

HTH,
Larry Bates
Syscon, Inc.

"Haim Ashkenazi" <haim at babysnakes.org> wrote in message
news:mailman.162.1088208475.27577.python-list at python.org...
> Hi
>
> I have to write a function that returns a list of all directories under
> <PATH> (should work on linux and windows). it should be easy to write a
> loop that goes through every directory... and so on, but I was wondering
> if there's faster/more economic way, something like 'find <PATH> -type d'.
> I couldn't find any 'find' module for python.
>
> any ideas?
>
> thanx
> -- 
> Haim
>
>
>





More information about the Python-list mailing list