You can use sys.byteorder:
>>> import sys
>>> print sys.byteorder
'little'
Or you can get endianness by yourself with a little help of the built-in struct module:
import struct
def is_little():
packed = struct.pack("i", 1)
return packed[0] == "\x01";
print is_little()
That was all Python of course.