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


Groups > comp.lang.python > #31934

Re: Style help for a Smalltalk-hack

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <travisgriggs@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.020
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'mrab': 0.05; 'chunk': 0.07; 'subject:help': 0.07; '22,': 0.09; 'fetch': 0.09; 'slightly': 0.15; 'chunk:': 0.16; 'oct': 0.16; 'read:': 0.16; 'travis': 0.16; 'true:': 0.16; 'wrote:': 0.17; 'thanks,': 0.18; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'appreciated.': 0.26; 'it."': 0.29; 'signatures': 0.29; 'could': 0.32; 'skip:l 40': 0.33; 'to:addr:python-list': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'received:172.16': 0.34; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'message-id:@gmail.com': 0.36; 'charset:us-ascii': 0.36; 'does': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'subject:-': 0.40; 'header:Received:5': 0.40; 'think': 0.40; 'header:Message-Id:1': 0.62; 'between': 0.63; 'different': 0.63; 'great': 0.64; 'localized': 0.84; 'habit': 0.91; 'ideas.': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=9ibByp/T1PdBfwT6ldIhoO62jEURcZLnsYMRluzvRVU=; b=weLMVoG9fW6jCKz/mts+q8DsxJMOfbo+aAL7oG1tjPnEiAuEoBVsUGV9SAyL/4lhjP rIdjhYR+LEdnFZpb6YIX0YKvrN3PaDH1nwbKzt3gfD87Ymj8d2obPqzzoLbeRCHwPZjY H2SdlmfEu7V4GjhwatvCkwE9Yrlbrn4On0h5Bo1vYdlj32VH48BiD4waOH3UTn/A9kJJ 8WdrhBCZIu7x73VnQkF+q8NWRTnEsRLsoEv7VX/r3Ecp7pUrZkwWUAg1B0ulLPc43WRT 2O5f2pvkMG3f0QFXjDW4871nVdCuvSB31kNovDXjqE+sWig4Fln3dCBx7FtFAxqaQbut Uimw==
Content-Type text/plain; charset=us-ascii
Mime-Version 1.0 (Mac OS X Mail 6.2 \(1499\))
Subject Re: Style help for a Smalltalk-hack
From Travis Griggs <travisgriggs@gmail.com>
In-Reply-To <5085F3DA.1010809@mrabarnett.plus.com>
Date Tue, 23 Oct 2012 08:13:25 -0700
Content-Transfer-Encoding quoted-printable
References <168DF25C-0C43-45F2-BEDC-17AC4210F207@gmail.com> <5085F3DA.1010809@mrabarnett.plus.com>
To python-list@python.org
X-Mailer Apple Mail (2.1499)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2668.1351005210.27098.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1351005210 news.xs4all.nl 6982 [2001:888:2000:d::a6]:40095
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31934

Show key headers only | 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