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


Groups > comp.lang.python > #46810

Re: How to get an integer from a sequence of bytes

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'algorithm': 0.04; 'widely': 0.05; 'memory.': 0.07; 'smallest': 0.07; 'bits': 0.09; 'subject:How': 0.10; '8-bit': 0.16; 'assigns': 0.16; 'bits.': 0.16; 'byte,': 0.16; 'merely': 0.16; 'rewriting': 0.16; 'unpacking': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'code,': 0.22; 'header:User-Agent:1': 0.23; 'byte': 0.24; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'character': 0.29; 'characters': 0.30; 'ok.': 0.31; 'languages': 0.32; 'subject:from': 0.34; 'common': 0.35; 'but': 0.35; '+0200,': 0.36; 'machine.': 0.36; 'unit': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:172.20': 0.60; 'such': 0.63; 'received:74.208': 0.68; 'subject:get': 0.81; 'received:74.208.4.194': 0.84; 'edwards': 0.91; '2013': 0.98
Date Mon, 03 Jun 2013 18:07:41 -0400
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6
MIME-Version 1.0
To python-list@python.org
Subject Re: How to get an integer from a sequence of bytes
References <knvrhf$n5n$1@news.albasani.net> <mailman.2253.1369668622.3114.python-list@python.org> <ko85jp$vn3$1@news.albasani.net> <mailman.2447.1369941788.3114.python-list@python.org> <kog67o$pt2$1@news.albasani.net> <mailman.2571.1370224134.3114.python-list@python.org> <koi9ch$3ps$1@reader1.panix.com>
In-Reply-To <koi9ch$3ps$1@reader1.panix.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:4kz81Tclw8oyFSynGpOdlMeDW7olnR7xMqW9NU0kJ09 iBf0dXDcRSTZqiV7jceDgd0QYve2Ul5lFzH3rFrlXKbYwPq+Mj /oyFZxAhkSx9mN21y8XGJQqI8JrkyM1rF6ilAEqT2e9mkeamNG cOtnVvTx9u35TOGsK4IRVl10IqG39GJqbjY4r3EKCJlRJMHNwa yVKHFMOGwf/W1rETzigAgSHRlYvSVnJoNk6PNDnsasTrpKtfr/ 3N+iZCCyDI+W8Uj3cTyY93BiOBEdQO6MK2UD2jbW/k4WfDMckp s+3cK2F8fJuLBJ9lw/5Eb9BXRkUi6sKS2Tnx75QQvDkc3MOKg= =
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.2607.1370297269.3114.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1370297269 news.xs4all.nl 15942 [2001:888:2000:d::a6]:35453
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:46810

Show key headers only | View raw


On 06/03/2013 10:31 AM, Grant Edwards wrote:
> On 2013-06-03, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:
>> On Sun, 02 Jun 2013 21:25:45 +0200, Mok-Kong Shen
>> <mok-kong.shen@t-online.de> declaimed the following in
>> gmane.comp.python.general:
>>
>>
>>> b'7' is the byte with the character 7 in a certain code, so that's
>>> ok. In other PLs one assigns an int to a byte, with that int in either
>>
>> 	In other languages "byte" is an 8-bit signed/unsigned numeric.
>
> That's a common assumption, but historically, a "byte" was merely the
> smallest addressable unit of memory.  The size of a "byte" on widely
> used used CPUs ranged from 4 bits to 60 bits.
>

<Hehe> I recall rewriting the unpacking algorithm to get the 10 
characters from each byte, on such a machine.


-- 
DaveA

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


Thread

How to get an integer from a sequence of bytes Mok-Kong Shen <mok-kong.shen@t-online.de> - 2013-05-27 16:45 +0200
  Re: How to get an integer from a sequence of bytes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-27 15:00 +0000
    RE: How to get an integer from a sequence of bytes Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-28 03:37 +0300
  Re: How to get an integer from a sequence of bytes Ned Batchelder <ned@nedbatchelder.com> - 2013-05-27 11:30 -0400
    Re: How to get an integer from a sequence of bytes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-28 00:31 +0000
      Re: How to get an integer from a sequence of bytes Dave Angel <davea@davea.name> - 2013-05-27 20:41 -0400
    Re: How to get an integer from a sequence of bytes Mok-Kong Shen <mok-kong.shen@t-online.de> - 2013-05-30 20:26 +0200
      Re: How to get an integer from a sequence of bytes Ian Kelly <ian.g.kelly@gmail.com> - 2013-05-30 12:42 -0600
        Re: How to get an integer from a sequence of bytes jmfauth <wxjmfauth@gmail.com> - 2013-05-30 11:53 -0700
      Re: How to get an integer from a sequence of bytes Ned Batchelder <ned@nedbatchelder.com> - 2013-05-30 15:22 -0400
        Re: How to get an integer from a sequence of bytes Mok-Kong Shen <mok-kong.shen@t-online.de> - 2013-06-02 21:25 +0200
          Re: How to get an integer from a sequence of bytes Chris Angelico <rosuav@gmail.com> - 2013-06-03 05:54 +1000
          Re: How to get an integer from a sequence of bytes Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-02 21:48 -0400
            Re: How to get an integer from a sequence of bytes Grant Edwards <invalid@invalid.invalid> - 2013-06-03 14:31 +0000
              Re: How to get an integer from a sequence of bytes Dave Angel <d@davea.name> - 2013-06-03 18:07 -0400
                Re: How to get an integer from a sequence of bytes Grant Edwards <invalid@invalid.invalid> - 2013-06-03 22:34 +0000
              Re: How to get an integer from a sequence of bytes Dan Stromberg <drsalists@gmail.com> - 2013-06-03 15:41 -0700
                Re: How to get an integer from a sequence of bytes Grant Edwards <invalid@invalid.invalid> - 2013-06-04 13:39 +0000
                Re: How to get an integer from a sequence of bytes Joshua Landau <joshua.landau.ws@gmail.com> - 2013-06-04 20:51 +0100
                Re: How to get an integer from a sequence of bytes Chris Angelico <rosuav@gmail.com> - 2013-06-05 07:49 +1000
                Re: How to get an integer from a sequence of bytes Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-04 20:34 -0400
                Re: How to get an integer from a sequence of bytes Tim Roberts <timr@probo.com> - 2013-06-04 22:11 -0700
                Re: How to get an integer from a sequence of bytes Fábio Santos <fabiosantosart@gmail.com> - 2013-06-12 15:00 +0100
                Re: How to get an integer from a sequence of bytes Grant Edwards <invalid@invalid.invalid> - 2013-06-12 14:42 +0000
              RE: How to get an integer from a sequence of bytes Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-06-04 02:18 +0300
                Re: How to get an integer from a sequence of bytes Grant Edwards <invalid@invalid.invalid> - 2013-06-04 13:42 +0000
                RE: How to get an integer from a sequence of bytes Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-06-04 16:58 +0300
              Re: How to get an integer from a sequence of bytes Dan Stromberg <drsalists@gmail.com> - 2013-06-03 16:47 -0700
  Re: How to get an integer from a sequence of bytes Grant Edwards <invalid@invalid.invalid> - 2013-05-28 16:04 +0000

csiph-web