HowTo distinguish between File and Directory

Erik Max Francis max at alcyone.com
Mon Jan 19 14:55:00 EST 2004


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?

There's certainly one in the os module:  os.path.isdir and
os.path.isfile.

-- 
 __ Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
/  \ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
\__/ The critical period in matrimony is breakfast-time.
    -- A.P. Herbert



More information about the Python-list mailing list