Check if a file is a directory

    0

    4

    Python public recipes

    The os.path.isdir function tests to see if the given path is a directory. If the path is a directory, then the return value is true.

    Shortcut: file.isdir

    import os
    
    os.path.isdir(path)
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.