Last active
December 10, 2016 04:27
-
-
Save nariaki3551/ec51cdc00e145e296953071458c27543 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
# pip3(pip) install sh で shをインストールしておく必要がある | |
from sh import pip3 | |
package_list = [row.split()[0] for row in list(pip3('list', '-o', '--format=columns'))[2:]] | |
if len(package_list) == 0: | |
print('All package are already up-to-date!') | |
else: | |
if 'pip' in package_list: | |
package_list.remove('pip') | |
package_list.insert(0,'pip') | |
for package in package_list: | |
print('install --upgrade '+package) | |
print(pip3('install', '--upgrade', package)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment