circuitpython/tests/basics/int_bytes_long.py

8 lines
138 B
Python
Raw Normal View History

b = bytes(range(20))
il = int.from_bytes(b, "little")
ib = int.from_bytes(b, "big")
print(il)
print(ib)
print(il.to_bytes(20, "little"))