Python: filename contains String (metachar?)
You can use glob. It's very handy and similar to find command in Linux.
import glob
glob.glob("/home/user/*.txt")
Search in multiple subdirectories
glob.glob("/home/user/*/*.txt")
or
glob.glob("/home/user/logs?.txt")
I think you are looking for fnmatch:
https://docs.python.org/3/library/fnmatch.html#module-fnmatch