import requests
# Define the file URL
file_url = "https://github.com/<username>/<repository>/raw/<branch>/<path_to_file>"
# Send a GET request to download the file
response = requests.get(file_url)
# Check if the request was successful
if response.status_code == 200:
# Extract the file name from the URL
file_name = file_url.split("/")[-1]
# Save the file to a desired location
with open(file_name, "wb") as file:
file.write(response.content)
print("File downloaded successfully.")
else:
print(f"Failed to download the file. Error code: {response.status_code}")