Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)
# I am ashamed for writing this. | |
import inspect; | |
class Cin: | |
""" time to whip out some python magic """ | |
def __rshift__(self, other): | |
# I don't want to require that "other" is declared global. | |
cin = input(); |
Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)