Skip to content

Instantly share code, notes, and snippets.

View john-kelly's full-sized avatar

John Kelly john-kelly

View GitHub Profile
@john-kelly
john-kelly / subprocess_pipe.md
Created September 30, 2021 04:18 — forked from waylan/subprocess_pipe.md
Writing to a python subprocess pipe

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)