3 ways to download file in Python

[1] Using requests

import requests
URL = "https://archive.org/download/embeddingmodel/GoogleNews-vectors-negative300.bin.gz"
response = requests.get(URL)
open(URL.split('/')[-1], "wb").write(response.content)

[2] Using wget

pip install wget

URL = "https://archive.org/download/embeddingmodel/GoogleNews-vectors-negative300.bin.gz"
response = wget.download(URL,URL.split('/')[-1])

[3] Using urllib

pip install urllib

from urllib import request
URL = "https://archive.org/download/embeddingmodel/GoogleNews-vectors-negative300.bin.gz"
response = request.urlretrieve(URL,URL.split('/')[-1])