1
2
3
4
5
6
7
8
def download_photo():
root = "g:/emojis/"
url = "https://jums.club/images/avatar.jpg"
with open(root + "name.jpg", "wb") as file:
r = requests.get(url).content ## This is the main code
file.write(r) ## the main code too
if __name__ == "__main__":
download_photo()

写在最后

欢迎大家关注鄙人的公众号【麦田里的守望者zhg】,让我们一起成长,谢谢。
微信公众号