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)