Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to check whether file exists in python

import os.path

if os.path.isfile('filename.txt'):
    print ("File exist")
else:
    print ("File not exist")
Source by linuxize.com #
 
PREVIOUS NEXT
Tagged: #check #file #exists #python
ADD COMMENT
Topic
Name
4+3 =