how to download large file using python, requests without exhausting device ram.
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
|chunk_size = 4096|
|filename = "logo.png"|
|document_url = "https://wasi0013.files.wordpress.com/2018/11/my_website_logo_half_circle_green-e1546027650125.png"|
|with requests.get(document_url, stream=True) as r:|
|with open(filename, 'wb') as f:|
|for chunk in r.iter_content(chunk_size):|