[Tutor] listdir()
Jeff Shannon
jeff at ccvcorp.com
Fri Jul 2 21:24:30 EDT 2004
Ole Jensen wrote:
> Jeff Shannon wrote:
>
>>Look into the os.isdir() function, which will tell you easily whether
>>a given pathname is a directory or not. You will, however, need to do
>>your own sorting if you want directories to appear before regular
>>files. (Of course, you'd probably want to sort entries anyhow, since
>>IIRC the ordering returned by os.listdir() is arbitrary.)
>
>
> I guess you mean os.path.isdir()... I'll have a look at it.
> Thanks.
Ah, yes, I was replying from memory, and the details sometimes slip...
> IIRC - what's that?
IIRC == if I remember correctly
Jeff Shannon
Technician/Programmer
Credit International
More information about the Tutor
mailing list