Skip to content

Instantly share code, notes, and snippets.

@greut
Created March 16, 2018 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greut/1f2cd01e513d3cee209f98ac1f1ead68 to your computer and use it in GitHub Desktop.
Save greut/1f2cd01e513d3cee209f98ac1f1ead68 to your computer and use it in GitHub Desktop.
import subprocess
with open("foo.py.gz", "wb") as f:
q = subprocess.Popen(["gzip"], stdout=f, stdin=subprocess.PIPE)
p = subprocess.Popen(["more", "foo.py"], stdout=q.stdin)
q.communicate()
p.wait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment