another question about buffers

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Sat Apr 22 05:28:32 EDT 2006


In article <1145645420.014839.260540 at g10g2000cwb.googlegroups.com>,
 nephish at xit.net wrote:

>databack = sockobj.recv(1028)
>if databack:
>	print 'caught a message %s bytes ' % len(databack)
>else:
>	print 'fail to recieve data from server'
>
>the output in the terminal runs fine until it fails to get the
>databack, it prints out the "fail to receive from server" bit.

Perhaps the string you are receiving back on the second recv is being 
interpreted as False.



More information about the Python-list mailing list