python 双击更新所有已安装的python模块
当前位置:以往代写 > Python教程 >python 双击更新所有已安装的python模块
2019-06-14

python 双击更新所有已安装的python模块

python 双击更新所有已安装的python模块
python">
import subprocess

command = "pip list --outdated"

outdatelist  = subprocess.Popen (command, stdout=subprocess.PIPE,stderr=subprocess.PIPE, shell = True).stdout.readlines()

updatelist = [x.split("(")[0] for x in outdatelist ]

for x in updatelist:
    tempcmd = "pip install -U " + x
    print subprocess.Popen (tempcmd, stdout=subprocess.PIPE,stderr=subprocess.PIPE, shell = True).stdout.readlines()

print u"所有模块都已更新完毕!!"

标签:python

    关键字:

在线提交作业