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])



上一篇:pandas的to_sql的坑if_exists=append
下一篇:matplotlib.category: Using categorical units to plot a list of strings

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