It's unclear how code supposed to work, but there is glob:
glob.glob('*config_file*') # returns list of matching filenames in current directory glob.glob('*config_file*')[0] # if you are sure that there is only one matching file glob.glob(r'D:\mainfolder\*config_file*') # should work, I am not using Windows, returns list of paths glob.glob(r'D:\**\*config_file*', recursive=True) # search recursively in D subfolders
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.