Listing directory contents

Christopher J McMillan christopherjmcmillan at eaton.com
Wed May 23 13:22:43 EDT 2001


Thanks Fredrik! --- When I said inefficient I wasn't referring to my machine,
but rather my lazy fingers!

Cheers,

Chris


Fredrik Lundh wrote:

> Christopher J McMillan wrote:
> > Hello, newbie here!  I was wondering if there was a more efficient way
> > to list the contents of my local working directory then what I'm using"
> >
> > os.listdir(os.getcwd())
>
> what's so inefficient about that?
>
> you can save some typing by using:
>
>     os.listdir(".")
>
> but I'm not sure it's really faster on any contemporary operating
> system... (no time for benchmarks today, sorry ;-)
>
> Cheers /F




More information about the Python-list mailing list