Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #92837 > unrolled thread

Re: ctypes and byte order

Started byTerry Reedy <tjreedy@udel.edu>
First post2015-06-18 13:02 -0400
Last post2015-06-18 13:02 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: ctypes and byte order Terry Reedy <tjreedy@udel.edu> - 2015-06-18 13:02 -0400

#92837 — Re: ctypes and byte order

FromTerry Reedy <tjreedy@udel.edu>
Date2015-06-18 13:02 -0400
SubjectRe: ctypes and byte order
Message-ID<mailman.604.1434647011.13271.python-list@python.org>
On 6/18/2015 5:39 AM, Jean-Michel Pichavant wrote:

> I'm currently writing python code that writes a small binary file to
> be used by another device which code is written in C. The python code
> runs on a little endian CPU, and unfortunately, the other device is
> using a big endian MIPS.

The struct module is designed for this.  It reads and writes packed 
binary data of various types and sizes in either big or little endian 
order.  It should be easier than ctypes.

-- 
Terry Jan Reedy

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web