how to open a zip file with python code example
Example 1: python zip file open as text
with ZipFile('spam.zip') as myzip:
with myzip.open('eggs.txt') as myfile:
eggs = io.TextIOWrapper(myfile)
Example 2: zip python
>>> x = [1, 2, 3]
>>> y = [4, 5, 6]
>>> zipped = zip(x, y)
>>> list(zipped)
[(1, 4), (2, 5), (3, 6)]
>>> x2, y2 = zip(*zip(x, y))
>>> x == list(x2) and y == list(y2)
True