How to get an integer from a sequence of bytes

Grant Edwards invalid at invalid.invalid
Tue May 28 12:04:01 EDT 2013


On 2013-05-27, Mok-Kong Shen <mok-kong.shen at t-online.de> 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?

One way is using the struct module.

-- 
Grant Edwards               grant.b.edwards        Yow! Uh-oh!!  I forgot
                                  at               to submit to COMPULSORY
                              gmail.com            URINALYSIS!



More information about the Python-list mailing list