import requests

url = 'https://www.python.org/ftp/python/3.8.1/python-3.8.1.exe'

resp = requests.get(url)

with open('C:\\Users\\del\\Desktop\\新建文件夹\\2.exe','wb') as f:
    f.write(resp.content)

 

执行结果:

 

下载成功,说明此文件下载成功

 

python+requests——读取二进制文件并保存在本地——一个应用程序作为示例_desktop