2015-06-29 74 views

回答

2

使用補充int.from_bytes並再次指定字節順序。

>>> n = 257 
>>> n_bytes = n.to_bytes(2, "little") 
>>> n_again = int.from_bytes(n_bytes, "little") 
>>> n_again == n 
True