int.from_bytes()

http://www.adilwaseem.com/

Introduction
Return the integer represented by the given array of bytes.

Syntax
int.from_bytes(bytes, byteorder, *, signed=False) -> int

Parameters
  • byteorder must be either 'little' or 'big'.
  • from_bytes() argument 2 must be str, not int

Examples
The output is:
 >>> int.from_bytes(b'Python Lake', byteorder='big')
97287619261264698714188645
>>> int.from_bytes(b'Python Lake', byteorder='little')
122608595814425519419849040

Comments