How to measure download speed and progress using requests?

see here: Python progress bar and downloads i think the code would be something like this, it should show the average speed since start as bytes per second: import requests import sys import time def downloadFile(url, directory) : localFilename = url.split(“https://stackoverflow.com/”)[-1] with open(directory + “https://stackoverflow.com/” + localFilename, ‘wb’) as f: start = time.clock() r = … Read more