One - One Code All

Blog Content

python读取环境变量

Python   2020-07-31 23:20:09

这个完全是做个备忘贴。

在k8s里部署python服务,读取环境变量。

import os
env_dist = os.environ  # environ是在os.py中定义的一个dict environ = {}
for key in env_dist:
    print(key + ' : ' + env_dist[key])



上一篇:RHSA-2020:2432-中危: microcode_ctl 安全和BUG修复更新
下一篇:RHSA-2020:2894-重要: dbus 安全更新

The minute you think of giving up, think of the reason why you held on so long.