나는 Progress Bar가있는 URL에서 Python3로 다운로드하기를 원한다. atm을 가지고있는 코드는 한 줄에 머 무르지 않고 대신 수백 줄의 새로운 lines.Is를 인쇄하여 모양이 깔끔하게 보이고 디자인이 바뀌도록 제한합니다.커맨드 라인에서 스팸으로부터 tqdm을 막을 수있는 방법이 있습니까?
class TqdmUpTo(tqdm):
"""Provides `update_to(n)` which uses `tqdm.update(delta_n)`."""
def update_to(self, b=1, bsize=10, tsize=None):
"""
b : int, optional
Number of blocks transferred so far [default: 1].
bsize : int, optional
Size of each block (in tqdm units) [default: 1].
tsize : int, optional
Total size (in tqdm units). If [default: None] remains unchanged.
"""
if tsize is not None:
self.total = tsize
self.update(b * bsize - self.n) # will also set self.n = b * bsize
def downloader(urllink, filename):
with TqdmUpTo(unit='B', unit_scale=True, miniters=1,
desc=urllink.split('/')[-1]) as t: # all optional kwargs
urllib.request.urlretrieve(urllink, filename=filename, reporthook=t.update_to, data=None)
이와 비슷한 것이 좋습니다.
100 % | ████████████████████████████▉ | 8,014분의 8,014 [1시 37분 < 0시, 82.29files/s의] (출처 : https://github.com/tqdm/tqdm)
희망 누군가이 가능하다면 ... 사전에
감사 나를 도울 수 :)
Google에서 처음 명중 : https://pypi.python.org/pypi/progressbar2 기본적으로 '\ r'을 사용하여 줄의 처음으로 돌아가서 다시 인쇄합니다. – Jeronimo
죄송합니다.하지만 도움이되지 않습니다. -.- 이미 읽었지만 Loop 대신 Url을 사용하는 방법에 대해서는 전혀 모른다. (필자는 Python에 익숙하지 않다.) –