Answers for "python os check if file with extension exists"

0

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")
Posted by: Guest on October-21-2021

Code answers related to "python os check if file with extension exists"

Python Answers by Framework

Browse Popular Code Answers by Language