📅  最后修改于: 2022-03-11 14:45:22.374000             🧑  作者: Mango
import requests
file_url = 'https://www.journaldev.com/wp-content/uploads/2019/08/Python-Tutorial.png'
file_object = requests.get(file_url)
with open('Python-Tutorial.png', 'wb') as local_file:
local_file.write(file_object.content)
#The file will be downloaded in the same directory as the Python script.
#If you want to change the directory location,
#you can provide a complete path or relative path in the open() function call.