HowTo distinguish between File and Directory
Scott F
sdfATexpertuneDOTcom
Mon Jan 19 15:14:33 EST 2004
Peter Hansen <peter at engcorp.com> wrote in
news:400C35C2.2C46EE3C at engcorp.com:
> Scott F wrote:
>>
>> On Win32, is there a function in the standard modules that can
>> take a pathname and return whether it refers to a File or a
>> Directory?
>
> import os
> os.path.isfile(name)
> os.path.isdir(name)
>
> Is that adequate?
Yes. I only did a dir(os) and thus didn't see the items under path.
Thanks Peter (and Erik).
Scott
More information about the Python-list
mailing list