Skip to content

Instantly share code, notes, and snippets.

@hlian
Created March 31, 2010 04:41
Show Gist options
  • Select an option

  • Save hlian/349945 to your computer and use it in GitHub Desktop.

Select an option

Save hlian/349945 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import os
import subprocess
import sys
p = subprocess.Popen([sys.argv[1]], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
for line in open(sys.argv[2]):
p.stdin.write(line)
p.stdin.flush()
sys.stdout.write(p.communicate()[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment