How to tell machines endianism.

Steve Holden steve at holdenweb.com
Tue Aug 15 13:31:10 EDT 2006


KraftDiner wrote:
> How can you tell if the host processor is a big or little endian
> machine?
> 

One possible way is to use the struct module to encode an integer value 
in native and little-endian modes and see if the result comes out the 
same or different.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb       http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the Python-list mailing list