check if dir exists

Skip Montanaro skip at pobox.com
Wed Jul 9 21:21:41 CEST 2003


    Geiregat> How can I check if a dir exists ?

    >>> import os
    >>> print os.path.isdir("/tmp")
    True
    >>> print os.path.isdir("/foo")
    False

Skip





More information about the Python-list mailing list