Python Forum
python environment variables
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python environment variables
#1
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
Reply
#2
Are you asking how to access environment variables with Python? Or something else?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Installing python packages in a virtual environment Led_Zeppelin 1 714 Aug-15-2023, 08:18 PM
Last Post: deanhystad
  Understanding venv; How do I ensure my python script uses the environment every time? Calab 1 2,160 May-10-2023, 02:13 PM
Last Post: Calab
  Python development environment standenman 3 1,524 May-04-2023, 07:24 PM
Last Post: snippsat
  Python Scripting Environment jpotter0 1 1,625 Nov-19-2022, 03:07 PM
Last Post: snippsat
  How do I link the virtual environment of that project to the 3.9.2 version of python? Bryant11 1 1,332 Feb-26-2022, 11:15 AM
Last Post: Larz60+
  VS Code debugger using wrong Python environment topfox 0 2,429 Jun-09-2021, 10:01 AM
Last Post: topfox
  Virtual environment and upgrading python 3.5 to 3.9 NeilUK 4 11,979 Jan-24-2021, 01:02 PM
Last Post: snippsat
  Installing keras in Python 2.7 environment ErnestTBass 3 5,359 Nov-01-2020, 08:36 PM
Last Post: jefsummers
  Python in Linux environment on RPI kendias 22 10,914 Sep-05-2020, 03:04 AM
Last Post: K_Research
  Unable to install virtual environment on python 3.8.3 Allen10 4 3,047 Jun-04-2020, 04:22 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020