I am trying to not use an absolute path for my configuration file because I need this deployed in multiple environments, what is my best option here
The Below code is what I have tried and it is not able to find the path, however I am able to cat the file in the same location. I am using Python3.6 on a Redhat server.
with open("~/scripts/config.yml", 'r') as ymlfile:
cfg = yaml.load(ymlfile)
I am getting the below error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: '~/scripts/config.yml'