Accessing Environment Variables with Python 3

Background

Soon I’ll be adding support for environment variables into a side-project of mine: https://gitlab.com/chicken231/eat-a-py.

Here is a simple way to define a list of environment variables you want to capture by name, and return the name and their value as a pretty dictionary.

Code

  • Link to Python code snippet: https://gitlab.com/snippets/1731184

References

  • https://stackoverflow.com/questions/4906977/how-do-i-access-environment-variables-from-python

© 2019. All rights reserved.

Powered by Hydejack v8.5.2