Downloader modo texto - Python 3
Publicado por Fernando (última atualização em 25/11/2013)
[ Hits: 4.325 ]
Homepage: https://github.com/phoemur/
Pequeno programa para demonstrar uma downloadbar em modo texto.
Uso:
$ ./wget.py <link>
#!/bin/env python3
import os, sys
from urllib.request import urlretrieve
def reporthook(blocknum, blocksize, totalsize):
readsofar = blocknum * blocksize
if totalsize > 0:
percent = readsofar * 100 / totalsize
if percent >= 100.0:
sys.stdout.write("\n")
return
s = "\rProgress: {0:.1f}% [{1}{2}] {3} / {4}".format(percent, "#"*int(percent//2), "."*int(50-(percent//2)), readsofar, totalsize)
sys.stdout.write(s)
else: # total size is unknown
sys.stdout.write("read {}\n".format(readsofar))
for link in sys.argv[1:]:
print("\nDownloading {}:".format(link))
urlretrieve(link, os.path.basename(link), reporthook)
Script em Python 3.6 conectando em um API real da web
Google scan com interface gráfica
Cirurgia para acelerar o openSUSE em HD externo via USB
Void Server como Domain Control
Modo Simples de Baixar e Usar o bash-completion
Monitorando o Preço do Bitcoin ou sua Cripto Favorita em Tempo Real com um Widget Flutuante
Como quebrar senha usando john the ripper
[Resolvido] VirtualBox can't enable the AMD-V extension
Como verificar a saúde dos discos no Linux
Como instalar , particionar, formatar e montar um HD adicional no Linux?
Não consigo instalar distro antiga no virtualbox nem direto no hd (21)
Podem me chamar de 1mbecil :) [RESOLVIDO] (29)









