def download_file(url, filename):
    'Downloads file from url to a path with filename'
    r = requests.get(url, stream=True)
    if (not r.ok):
        raise IOError('Unable to download file')
    with open(filename, 'wb') as f:
        f.write(r.content)
Downloads file from url to a path with filename
def download_file(url, filename):
    
    r = requests.get(url, stream=True)
    if (not r.ok):
        raise IOError('Unable to download file')
    with open(filename, 'wb') as f:
        f.write(r.content)