双击更新所有已安装的python模块,双击更新python模块,import subpr
文章由Byrx.net分享于2019-03-23 05:03:27
双击更新所有已安装的python模块,双击更新python模块,import subpr
import subprocesscommand = "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"所有模块都已更新完毕!!"
评论关闭