From cb2e7c09daefafad97618763f43c991baf8e9365 Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Sun, 17 Aug 2014 20:27:44 -0400 Subject: Initial commit --- filter.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 filter.py (limited to 'filter.py') diff --git a/filter.py b/filter.py new file mode 100755 index 0000000..59f27fe --- /dev/null +++ b/filter.py @@ -0,0 +1,17 @@ +#! /usr/bin/python2 +import os +import sys +from subprocess import PIPE, Popen + +os.environ["PARINIT"] = "85rTbgqR0d1 B=.,?!_A_a Q=_s>|+" + +for line in sys.stdin: + line = line.strip() + print line + if not line: + break +sys.stdout.flush() + +p = Popen("par", stdin=PIPE) +for line in sys.stdin: + p.stdin.write(line) -- cgit v1.2.3-70-g09d2