I assume that you mean "How to get environment variables?":
import os
username = os.environ['UserName']
Alternatively you can use:
username = os.getenv('UserName')
And to add / change your own variables, you can use:
os.putenv('MyVar', 'something I want to store')
source
share