python iterate over line of gzip file

41

import gzip
import io

with io.TextIOWrapper(io.BufferedReader(gzip.open(filename))) as file:
    for line in file:
        print line,

Comments

Submit
0 Comments