I want to list out all the environment variables in my system in python. The list should give me the name of the variable and its value.
I want to list out all the environment variables in my system in python. The list should give me the name of the variable and its value.
Using os module of python it is possible to list out the environment variables.
import os
for name, value in os.environ.items():
print("{0}: {1}".format(name, value))