Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31934

Re: Style help for a Smalltalk-hack

Subject Re: Style help for a Smalltalk-hack
From Travis Griggs <travisgriggs@gmail.com>
Date 2012-10-23 08:13 -0700
References <168DF25C-0C43-45F2-BEDC-17AC4210F207@gmail.com> <5085F3DA.1010809@mrabarnett.plus.com>
Newsgroups comp.lang.python
Message-ID <mailman.2668.1351005210.27098.python-list@python.org> (permalink)

Show all headers | View raw


On Oct 22, 2012, at 6:33 PM, MRAB <python@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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Style help for a Smalltalk-hack Travis Griggs <travisgriggs@gmail.com> - 2012-10-23 08:13 -0700

csiph-web