python os is directory

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

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)