9951 explained code solutions for 126 technologies


pythonHow to get environment variable value


import os
user = os.environ['USER']ctrl + c
import os

we need this module to set or get environment variables

user

will contain value of environment variable

os.environ['USER']

get USER environment variable