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.
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.