python os is directory

Solutions on MaxInterview for python os is directory by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "python os is directory"
Agustín
13 Nov 2017
1import os.path
2  
3# Path
4path = '/home/User/Documents/file.txt'
5  
6# Check whether the 
7# specified path is an
8# existing directory or not
9isdir = os.path.isdir(path)
10print(isdir)
11  
12  
13# Path
14path = '/home/User/Documents/'
15  
16# Check whether the 
17# specified path is an
18# existing directory or not
19isdir = os.path.isdir(path)
20print(isdir)