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"所有模块都已更新完毕!!"