Created
December 11, 2019 18:37
-
-
Save leftrk/b9e714e6fbd71c843839a9725cdd9dfd to your computer and use it in GitHub Desktop.
download file
This file contains hidden or 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 downloadFILE(url, name): | |
resp = requests.get(url=url, stream=True) | |
content_size = int(resp.headers['Content-Length']) / 1024 | |
with open(name, "wb") as f: | |
print("File total size is:", content_size, 'k,start...') | |
for data in tqdm(iterable=resp.iter_content(1024), total=content_size + 1, unit='k', desc=name): | |
f.write(data) | |
print(name + " download finished!") |
Code didn't run for me. Received a module not callable error. You need to call the function inside tqdm so tqdm.tqdm()
you must install tqdm
with pip;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code didn't run for me. Received a module not callable error. You need to call the function inside tqdm so tqdm.tqdm()