how to check if a file is a directory or regular file in python?


Question

Possible Duplicate:
How to identify whether a file is normal file or directory using python

How do you check if a path is a directory or file in python?

1
299
5/23/2017 11:47:25 AM

os.path.isdir() and os.path.isfile() should give you what you want. See: http://docs.python.org/library/os.path.html

152
9/3/2015 4:19:09 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon