SyntaxFix
Write A Post
Hire A Developer
Questions
If you are parsing the file after unzipping it, don't forget to use decode() method, is necessary when you open a file as binary.
import gzip with gzip.open(file.gz, 'rb') as f: for line in f: print(line.decode().strip())