Python Forum
python environment variables - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: python environment variables (/thread-11496.html)



python environment variables - riyengar - Jul-11-2018

Hello,

I am trying to load environment variables defined in a config file for use in another python script. Examples I see are like loading the file and parsing variables, etc.

Want to mimic shell behaviour where I can define a config file and source it in another shell script.

Script is primarily used to connect to different databases.

Whole objective is to maintain these in one place to accommodate for any changes.

Appreciate your help.

Cheers.
Raj


RE: python environment variables - micseydel - Jul-11-2018

Are you asking how to access environment variables with Python? Or something else?