Created
December 6, 2016 17:24
-
-
Save nariaki3551/db1c13e4d864d206442471e8f4cef121 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess as sp | |
package_list = [row.split()[0] for row in sp.getoutput('pip3 list -o --format=columns').split('\n')[2:]] | |
if package_list == []: | |
print('All packages are already up-to-data!!') | |
else: | |
if 'pip' in package_list: | |
p_list.remove('pip') | |
p_list.insert(0,'pip') | |
for package in package_list: | |
print('install --upgrade %s' % package) | |
sp.run(['pip3', 'install', '--upgrade', package]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment