e.g. a function should return:
- stackpath = "config/openvpn/openvpn02.json"
for stackname = "openvpn02".
How would I search "openvpn02.json" in the config directory?
like this
import os
to_search = "filename"
for dirpath, dirnames, filenames in os.walk("."):
for filename in [f for f in filenames if "".join(f.split(".")[:-1])==to_search]:
print os.path.join(dirpath, filename)