Answers for "get environment variable linux python"


get all environment variables python

""" lists environment variables, and splits elements in path variable """
import os

for k, v in sorted(os.environ.items()):
    print(k+':', v)
# list elements in path environment variable
[print(item) for item in os.environ['PATH'].split(';')]
Posted by: Guest on October-20-2020

Code answers related to "get environment variable linux python"

Python Answers by Framework

Browse Popular Code Answers by Language