import requests
import shutil
def download_file(url, local_filename):
"""
:param url: url连接
:param local_filename: 下载后保存文件名字
"""
with requests.get(url, stream=True) as r:
with open(local_filename, 'wb') as f:
shutil.copyfileobj(r.raw, f)
标签:python,param,filename,url,import,shutil,local,下载
From: https://www.cnblogs.com/yunhgu/p/16656892.html