python 获取环境变量
import os
# check
if 'HOME' in os.environ:
print("Yes!")
# read
print(os.environ.get('HOME', '/home/ubuntu'))
import os
# check
if 'HOME' in os.environ:
print("Yes!")
# read
print(os.environ.get('HOME', '/home/ubuntu'))