import requests downloaded_obj = requests.get(url) with open("python_logo.png", "wb") as file: file.write(downloaded_obj.content)