Style help for a Smalltalk-hack

Travis Griggs travisgriggs at gmail.com
Tue Oct 23 11:13:25 EDT 2012


On Oct 22, 2012, at 6:33 PM, MRAB <python at mrabarnett.plus.com> wrote:

> Another way you could do it is:
> 
> while True:
>    chunk = byteStream.read(4)
>    if not chunk:
>        break
>    ...
> 
> And you could fetch multiple signatures in one read:
> 
> signatures = list(struct.unpack('>{}I'.format(valveCount), byteStream.read(4 * valueCount)))

Thanks, both great ideas. Still does the read/decode slightly different between the different sites, but at least it's localized better. Much appreciated.

--
Travis Griggs
"History has a habit of changing the people who think they are changing it." -Terry Pratchett




More information about the Python-list mailing list