OS ENV Variables
General Information
Using OS environmental variables.
Checklist
- Import the “os” module
The Code
#!/usr/bin/python import os user_home=os.environ.get('HOME') print "Home is: " + user_home
python_wiki:os_env_variables
General Information
Using OS environmental variables.
Checklist
#!/usr/bin/python import os user_home=os.environ.get('HOME') print "Home is: " + user_home