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


Groups > comp.lang.python > #46116

Re: Output from to_bytes

From Terry Jan Reedy <tjreedy@udel.edu>
Subject Re: Output from to_bytes
Date 2013-05-26 16:45 -0400
References <knstkh$74a$1@news.albasani.net>
Newsgroups comp.lang.python
Message-ID <mailman.2198.1369601157.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 5/26/2013 8:02 AM, Mok-Kong Shen wrote:
>     for k in range(8,12,1):
>       print(k.to_bytes(2,byteorder='big'))

http://bugs.python.org/issue9951
http://bugs.python.org/issue3532

import binascii as ba
for k in range(8,12,1):
     print(ba.hexlify(k.to_bytes(2,byteorder='big')))
 >>>
b'0008'
b'0009'
b'000a'
b'000b'

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


Thread

Output from to_bytes Mok-Kong Shen <mok-kong.shen@t-online.de> - 2013-05-26 14:02 +0200
  Re: Output from to_bytes Chris Angelico <rosuav@gmail.com> - 2013-05-26 23:26 +1000
  Re: Output from to_bytes Terry Jan Reedy <tjreedy@udel.edu> - 2013-05-26 16:45 -0400
  Re: Output from to_bytes Grant Edwards <invalid@invalid.invalid> - 2013-05-28 15:35 +0000
    Re: Output from to_bytes Mok-Kong Shen <mok-kong.shen@t-online.de> - 2013-06-02 21:09 +0200
      Re: Output from to_bytes Ned Batchelder <ned@nedbatchelder.com> - 2013-06-02 18:18 -0400

csiph-web