Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python os if file exists

import os.path

if os.path.isfile('filename.txt'):
    print ("File exist")
else:
    print ("File not exist")
 
PREVIOUS NEXT
Tagged: #python #os #file #exists
ADD COMMENT
Topic
Name
1+2 =