Python: Get Environment Variable

,
# -*- coding: utf-8 -*-
# python

# example of getting environment variable

import os
print os.getenv("HOME", "default value if none") # /home/xah

15.1. os — Miscellaneous operating system interfaces — Python v2.7.6 documentation #os.environ

blog comments powered by Disqus