Jon Ribbens jon+usenet at
Wed Jun 18 10:49:44 CEST 2003

In article <3EF02537.7050609 at>, Oleg Seifert wrote:
> def read():
>      print s.recv(1024)
> How can I print the whole response, independent of the structure
> (numer of lines) of the response?

You need to keep calling recv repeatedly to get the whole response.
recv(1024) doesn't mean "give me 1024 bytes", it means "don't give me
more than 1024 bytes".

def read():
  while 1:
    r = s.recv(1024)
    if not r: break

More information about the Python-list mailing list