Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python os is directory

import os.path
  
# Path
path = '/home/User/Documents/file.txt'
  
# Check whether the 
# specified path is an
# existing directory or not
isdir = os.path.isdir(path)
print(isdir)
  
  
# Path
path = '/home/User/Documents/'
  
# Check whether the 
# specified path is an
# existing directory or not
isdir = os.path.isdir(path)
print(isdir)
Comment

PREVIOUS NEXT
Code Example
Python :: creating a new folder in python 
Python :: how to install django in virtual environment in ubuntu 
Python :: tsv to csv python 
Python :: python sort list of lists by second element 
Python :: matplotlib multiple plots with different size 
Python :: python stack class 
Python :: sklearn fit pandas dataframe 
Python :: pandas read excel 
Python :: csv python write 
Python :: python print dictionary line by line 
Python :: procfile heroku django 
Python :: how to make a tick update in python 
Python :: element not found selenium stackoverflow 
Python :: how to use tensorboard 
Python :: replacing values in pandas dataframe 
Python :: python list group by count 
Python :: get number of bits for integer in python 
Python :: show pythonpath 
Python :: make text bold python 
Python :: open applications by python 
Python :: epoch to datetime utc python 
Python :: text to dictionary python 
Python :: Print a nested list line by line in python 
Python :: pandas query like 
Python :: how to visualize decision tree in python 
Python :: python strip multiple characters 
Python :: python log transform column 
Python :: update python in cmd 
Python :: python histogram as a dictionary 
Python :: scientific notation to decimal python 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =