Last active
December 16, 2015 16:36
-
-
Save nolram/fd3850aad53cd7d0a3e9 to your computer and use it in GitHub Desktop.
Atualização de todos os pacotes pip de Python 3.4
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
def update_all_pip(exceptions=[]): | |
''' | |
Esse método atualiza todos os pacotes instalados através do método call() | |
@arg: exceptions é uma lista de nomes de pacotes em caixa baixa que não serão atualizados | |
''' | |
to_update = pip.get_installed_distributions(skip=["setuptools", "python", "pip", | |
"distribute"]+exceptions) | |
for dist in range(0, len(to_update)): | |
print("Verificando o pacote %s - restando: %s de %s " % (to_update[dist], dist+1, len(to_update))) | |
call("pip install --upgrade "+ to_update[dist].project_name, shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment