Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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)
print('
')
# list elements in path environment variable
[print(item) for item in os.environ['PATH'].split(';')]
Source by gist.github.com #
 
PREVIOUS NEXT
Tagged: #environment #variables #python
ADD COMMENT
Topic
Name
5+4 =