with ZipFile('spam.zip') as myzip: with myzip.open('eggs.txt') as myfile: eggs = io.TextIOWrapper(myfile)