Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #79348
| References | <CAGGBd_r7tdPc1ZTA380-9aNRnbr6Dm3HzhG2cCH2sJwWn=c5iQ@mail.gmail.com> <mailman.14990.1413777392.18130.python-list@python.org> <87a94rgxi5.fsf@elektro.pacujo.net> <CAGGBd_qsZ=-8sn0YQPT1XQf9Qcn9cJ4Aw=hgR6=at0KzjN3xsg@mail.gmail.com> |
|---|---|
| Date | 2014-10-20 15:52 -0700 |
| Subject | Re: Flush stdin |
| From | Dan Stromberg <drsalists@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.15012.1413845578.18130.python-list@python.org> (permalink) |
If I run the following in one tty:
nc -l localhost 9000 | /tmp/z
...where /tmp/z has just:
#!/usr/bin/python3
import sys
for line in sys.stdin.buffer:
print(line)
And then run the following in another tty on the same computer:
while read line; do echo $line; sleep 1; done < /etc/passwd | nc
localhost 9000
...then everything acts line buffered, or perhaps even character
buffered (the two are pretty indistinguishable in this test). What I
see is my /etc/passwd file popping out of the nc -l side, one line at
a time, each line one second apart.
I suppose this suggests that it's the client that's sending TCP data
that is buffering.
That, or we're using two different versions of netcat (there are at
least two available).
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Flush stdin Cameron Simpson <cs@zip.com.au> - 2014-10-20 14:56 +1100
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-20 07:45 +0300
Re: Flush stdin Dan Stromberg <drsalists@gmail.com> - 2014-10-20 14:59 -0700
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-21 01:54 +0300
Re: Flush stdin Dan Stromberg <drsalists@gmail.com> - 2014-10-20 15:52 -0700
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-21 02:18 +0300
Re: Flush stdin Dan Stromberg <drsalists@gmail.com> - 2014-10-20 17:30 -0700
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-21 07:41 +0300
Re: Flush stdin Dan Stromberg <drsalists@gmail.com> - 2014-10-21 16:16 -0700
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-22 08:38 +0300
Re: Flush stdin Chris Angelico <rosuav@gmail.com> - 2014-10-22 17:23 +1100
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-22 13:57 +0300
Re: Flush stdin random832@fastmail.us - 2014-10-22 11:01 -0400
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-22 18:28 +0300
csiph-web