Код: Выделить всё
i = 0x12345678
print("{:08x}".format(i))
# Shows 12345678
i = swap32(i)
print("{:08x}".format(i))
# Should print 78563412
Подробнее здесь: https://stackoverflow.com/questions/275 ... -in-python
Код: Выделить всё
i = 0x12345678
print("{:08x}".format(i))
# Shows 12345678
i = swap32(i)
print("{:08x}".format(i))
# Should print 78563412