How to check if a path is a Directory in Python

To check if a path is a Directory in Python you can use the snippet below.

Sample Python

import os

print(os.path.isdir("/myfolder/folder1"))

Please Share us:
Please rate this snippet

3 thoughts on “How to check if a path is a Directory in Python

Leave a Reply