phyton zip code example
Example 1: python how to download zip
url = 'https://codeload.github.com/fogleman/Minecraft/zip/master'
# downloading with requests
# import the requests library
import requests
# download the file contents in binary format
r = requests.get(url)
# open method to open a file on your system and write the contents
with open("minemaster1.zip", "wb") as code:
code.write(r.content)
# downloading with urllib
# import the urllib library
import urllib
# Copy a network object to a local file
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)