Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python os check if file with extension exists

import os
if any(File.endswith(".txt") for File in os.listdir(".")):
    print("true")
else:
    print("false")
 
PREVIOUS NEXT
Tagged: #python #os #check #file #extension #exists
ADD COMMENT
Topic
Name
6+9 =