Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions snippets/python/get_environment_variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Get a Specific Environment Variable
*tags:* **os, python**

`os` is a built-in python module to interact with the operating system.

**Snippet**
```python
import os

# This is the environment variable that would be fetched.
# For example here we are getting the 'Path' environment
# variable
env_var = 'Path'

# fetched_result variable holds the value
# which was to be retrieved
fetched_result = os.environ[env_var]

```