I am stuck on an environment variables mismatch.
I run a Python script on Windows 10 via a program called NSSM.
At runtime, I do the following:
- Load in parameters from a text file
- Put its contents into the environment using
os.environ.setdefault(name, value)
. - Try to load in environment variables using
os.environ[name]
Result:any variables I added do not show up.
I am not sure why the variables I add aren't available. Can you please tell me what I am doing wrong?
A starting point is that NSSM uses environment variables from Windows HKLM registry: source (see bottom). I am not sure if this is the reason os.environ
cannot see relevant variables.