How to access C structures

Chris Helck Chris.Helck at us.icap.com
Thu Apr 16 11:02:38 EDT 2009


I have a couple dozen C structures that define binary file records. I
need to read the file and access the records. I need to do this very
efficiantly.

I am aware of the Python struct class, but the C structures contain
arrays of nested structures and I'm not sure if Python struct can handle
it. I am willing to give up portability for speed. I will run the Python
program on the same machine that the file was created on. 

Is there some way to directly expose a C struct to Python?

Regards,
C. Helck

**********************************************************************
This communication and all information (including, but not limited to,
 market prices/levels and data) contained therein (the "Information") is
 for informational purposes only, is confidential, may be legally
 privileged and is the intellectual property of ICAP plc and its affiliates
 ("ICAP") or third parties. No confidentiality or privilege is waived or
 lost by any mistransmission. The Information is not, and should not
 be construed as, an offer, bid or solicitation in relation to any
 financial instrument or as an official confirmation of any transaction.
 The Information is not warranted, including, but not limited, as to
 completeness, timeliness or accuracy and is subject to change
 without notice. ICAP assumes no liability for use or misuse of the
 Information. All representations and warranties are expressly
 disclaimed. The Information does not necessarily reflect the views of
 ICAP. Access to the Information by anyone else other than the
 recipient is unauthorized and any disclosure, copying, distribution or
 any action taken or omitted to be taken in reliance on it is prohibited. If
 you receive this message in error, please immediately delete it and all
 copies of it from your system, destroy any hard copies of it and
 notify the sender.
**********************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090416/690868f6/attachment.html>


More information about the Python-list mailing list