def isdir(s):
try:<EOL><INDENT>st = os.stat(s)<EOL><DEDENT>except os.error:<EOL><INDENT>return False<EOL><DEDENT>return stat.S_ISDIR(st.st_mode)<EOL>
Return true if the pathname refers to an existing directory.