Re: using os

2004-11-29 Thread Jeremy Jones
Jerry Sievers wrote: Juliano Freitas <[EMAIL PROTECTED]> writes: how can i get just the directories in other directorie without a files using the os module in Python?? If there's a command for listing only dirs, I've not stumbled on it. Here's a one-liner using filter

Re: using os

2004-11-29 Thread Jerry Sievers
Juliano Freitas <[EMAIL PROTECTED]> writes: > how can i get just the directories in other directorie without a > files using the os module in Python?? If there's a command for listing only dirs, I've not stumbled on it. Here's a one-liner using filter and lambda; from os import listdir from os.

Re: using os

2004-11-29 Thread Jean Brouwers
Check the os.walk() and os.path.walk() functions. More details and some examples are at resp. /Jean Brouwers In article <[EMAIL PROTECTED]>, Juliano Freitas <[EMAIL PROTECTED]> wrote: > how

Re: using os

2004-11-29 Thread Jeffrey Froman
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 -- http://mail.python.org/ma