defdownload_photo(): root = "g:/emojis/" url = "https://jums.club/images/avatar.jpg" withopen(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()