Skip to content

Instantly share code, notes, and snippets.

@shirou
Created March 20, 2014 06:30
Show Gist options
  • Save shirou/9658377 to your computer and use it in GitHub Desktop.
Save shirou/9658377 to your computer and use it in GitHub Desktop.
zcat vs gzip module
import sys
import gzip
def zcat():
count = 0
for line in sys.stdin:
count += 1
print count
def direct():
count = 0
fn = sys.argv[1]
f = gzip.open(fn, 'rb')
for line in f.readlines():
count += 1
print count
#zcat()
direct()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment