0 votes
1 view
in Python by (38.2k points)

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 Answer

0 votes
by (16.8k points)

os.path.isfile("bob.txt") # Does bob.txt exist?  Is it a file, or a directory?

os.path.isdir("bob")

Related questions

0 votes
1 answer
0 votes
1 answer
asked Oct 10, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
0 votes
1 answer
asked Jul 2, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...