2020
10-09
10-09
Python如何操作docker redis过程解析
使用操作命令借助subprocess模块进行操作#encoding:utf-8importsubprocessdefcmd(command):subp=subprocess.Popen(command,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding="utf-8")subp.wait(2)ifsubp.poll()==0:returnsubp.communicate()else:returnNone获取redis键所对应的值defget_output(command):subp=subprocess.getoutput(command)returnsubpflask框架获取docker里...
继续阅读 >