get a line of text from a socket...

KraftDiner bobrien18 at yahoo.com
Fri Aug 25 21:09:44 EDT 2006


Marc 'BlackJack' Rintsch wrote:
> In <1156523827.971633.321830 at m79g2000cwm.googlegroups.com>, KraftDiner
> wrote:
>
> > If you don't know how long your input data is going to be how can you
> > at least treat it a text line at a time... like looking for new line in
> > the data... Right now recv blocks.   Yes I could do a select, but the
> > examples seem a bit complicated for a simple line oriented input...
>
> This is already done in the `asyncore` and `asynchat` modules of the
> standard library.
>
> Ciao,
> 	Marc 'BlackJack' Rintsch

Thanks I can't seem to get this example to do anything except sit
there....
http://docs.python.org/lib/asyncore-example.html
And still it seems like a lot of work for a simple send/expect script.
I got the makefile to work.. there is a readline function how does one
use writelines to write one single line?




More information about the Python-list mailing list