Python download zip file code example
Example 1: python how to download zip
url = 'https://codeload.github.com/fogleman/Minecraft/zip/master'
import requests
r = requests.get(url)
with open("minemaster1.zip", "wb") as code:
code.write(r.content)
import urllib
urllib.urlretrieve(url, "minemaster.zip")
Example 2: zip python
>>> x = [1, 2, 3]
>>> y = [4, 5, 6]
>>> for t in zip(x, y):
... print(t)
...
(1, 4)
(2, 5)
(3, 6)
Example 3: zip python
number_list = [1, 2, 3]
str_list = ['one', 'two', 'three']
result = zip()
result_list = list(result)
print(result_list)
result = zip(number_list, str_list)
result_set = set(result)
print(result_set)
>>>[]
{(2, 'two'), (3, 'three'), (1, 'one')}