Skip to content

Instantly share code, notes, and snippets.

@jbernhard
Created April 6, 2015 17:09
Show Gist options
  • Save jbernhard/274faa1ea833fff7a522 to your computer and use it in GitHub Desktop.
Save jbernhard/274faa1ea833fff7a522 to your computer and use it in GitHub Desktop.
import subprocess
# Read a gzipped file from within Python.
# Faster than the standard library gzip module.
# Require Python 3.2+ for context manager support.
with subprocess.Popen(('zcat', filename), stdout=subprocess.PIPE) as proc:
for l in proc.stdout:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment