You can use glob.glob
with wildcards and check whether it returns anything. For instance:
import glob
if glob.glob('*.txt'):
# file(s) exist -> do something
else:
# no files found
Note that glob.glob
return a list of files matching the wildcard (or an empty list).