Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
read_dotenv problem
#4
In the future it would be nice to include link to github repo - it helps a lot
https://github.com/levensailor/ciscoaxl/...xamples.py

.env file is used to provide application settings via Environmental variables.
python-dotenv reads that file and exports the provided settings as Environmental variables
then look at the examples.py
dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
read_dotenv(dotenv_path)

cucm = os.getenv('cucm')
username = os.getenv('username')
password = os.getenv('password')
version = os.getenv('version')
as you can see, the scripts reads cucm, username, password and version from the environment variables.
check python-dotenv docs for specific instructions for .env file format

https://github.com/theskumar/python-dotenv
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
read_dotenv problem - by wolf8963 - Jan-24-2020, 04:21 AM
RE: read_dotenv problem - by Larz60+ - Jan-24-2020, 06:27 AM
RE: read_dotenv problem - by wolf8963 - Jan-25-2020, 04:37 AM
RE: read_dotenv problem - by buran - Jan-25-2020, 06:22 AM
RE: read_dotenv problem - by wolf8963 - Feb-06-2020, 07:23 PM

Forum Jump:

User Panel Messages

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