def find_filename(substring):
import os
import re
files = os.listdir(os.getcwd())
for file in files:
search = re.search(substring, file)
if search:
filename = file
break
return filename
file = find_filename('stringyouwant')
WindowExists(file)
This function will return the full filename that contains the shorter string that you require - however it will only work if the file you are searching for is the only file with that substring in that directory. If you want something more robust, you should modify the regular expression.