Skip to content

Instantly share code, notes, and snippets.

@jtr109
Last active August 16, 2017 00:15
Show Gist options
  • Save jtr109/cef3e8ed8e89062cccd7aaf31f3eb591 to your computer and use it in GitHub Desktop.
Save jtr109/cef3e8ed8e89062cccd7aaf31f3eb591 to your computer and use it in GitHub Desktop.
从环境变量中获取 WXAPP_TEST_SITEUSER
import os
WXAPP_TEST_SITEUSER = os.getenv('WXAPP_TEST_SITEUSER') # return None if not exist
# 环境变量可以在 shell 中手动赋值, 手动写入是一次性的.
# 也可以写进 ~/.bashrc 或 ~/.zshrc (根据具体情况确定) 中, 保证每次系统加载的时候都会调用赋值.
export WXAPP_TEST_SITEUSER = testuser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment