Python recv loop

Chris Angelico rosuav at gmail.com
Mon Feb 11 10:24:07 EST 2013


On Tue, Feb 12, 2013 at 2:11 AM, MRAB <python at mrabarnett.plus.com> wrote:
> I probably wouldn't make it fixed length. I'd have the length in
> decimal followed by, say, "\n".

Or even "followed by any non-digit". Chances are your JSON data begins
with a non-digit, so you'd just have to insert a space in the event
that you're JSON-encoding a flat integer. (Which might not ever
happen, if you know that your data will always be an object.)

ChrisA



More information about the Python-list mailing list