Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #79282

Re: Flush stdin

References <CABcP1UeH9ft0j++HbUpHDDWz4i=7eJrDU=kVXFN6LPHT3oNE6Q@mail.gmail.com>
Date 2014-10-19 12:23 +1100
Subject Re: Flush stdin
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.14976.1413681789.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Oct 17, 2014 at 10:38 PM, Empty Account <emptya45@gmail.com> wrote:
> I am using netcat to listen to a port and python to read stdin and print to
> the console.
>
> nc -l 2003 | python print_metrics.py

After lengthy discussion about what it means to flush stdin, I think
it's high time someone asked the question: Why not skip nc altogether,
and have your Python program do its own socket work? Then you don't
have to worry about stream flushing at all.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Flush stdin Chris Angelico <rosuav@gmail.com> - 2014-10-19 12:23 +1100

csiph-web