How to get an integer from a sequence of bytes

Ned Batchelder ned at nedbatchelder.com
Mon May 27 11:30:18 EDT 2013


On 5/27/2013 10:45 AM, Mok-Kong Shen wrote:
> From an int one can use to_bytes to get its individual bytes,
> but how can one reconstruct the int from the sequence of bytes?
>

The next thing in the docs after int.to_bytes is int.from_bytes: 
http://docs.python.org/3.3/library/stdtypes.html#int.from_bytes

--Ned.

> Thanks in advance.
>
> M. K. Shen




More information about the Python-list mailing list