What's the most Pythonic way of determining endianness?

放肆的年华 提交于 2019-12-03 00:59:17

The answer is in the sys module:

>>> import sys
>>> sys.byteorder
'little'

Of course depending on your machine it may return 'big'. Your method should certainly work too though.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!