I am trying to read in a python script some variables that I have in an environment file myfile.env:
LOCALHOST='1'
If in my python script I just run:
import os
print(os.environ)
It prints:
environ({'PATH': '....', 'HOSTNAME': '...', 'PYCHARM_HOSTED': '1', 'PYTHONUNBUFFERED': '1'})
But in these array I don't have the LOCALHOST variable. I found that I can use python-dotenv and now I see it and working, but I don't get why I have to use it, and it's not feasible to load them only using os module.