Skip to content

Instantly share code, notes, and snippets.

@cibervicho
Created February 29, 2024 16:53
Show Gist options
  • Save cibervicho/8ec8984cf26e8e7323e829528447f1e3 to your computer and use it in GitHub Desktop.
Save cibervicho/8ec8984cf26e8e7323e829528447f1e3 to your computer and use it in GitHub Desktop.
tqdm example
# $ cat requirements.txt
# tqdm==4.66.2
import time
from tqdm import tqdm
def instalar_dependencia(dependencia):
time.sleep(1)
def main():
dependencias = ["paquete1", "paquete2", "paquete3"]
with tqdm(total=len(dependencias), ncols=100, colour='green') as pbar:
for dependencia in dependencias:
pbar.set_description(f"Instalando {dependencia}")
instalar_dependencia(dependencia)
pbar.update(1)
print("¡Todas las dependencias se han instalado correctamente!")
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment