On 05/27/2013 08:31 PM, Steven D'Aprano wrote:
On Mon, 27 May 2013 11:30:18 -0400, Ned Batchelder wrote:

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:

And I can't believe I missed that too :-(


And that approach probably works for negative ints too.


--
DaveA
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to