Re: [ctypes-users] Best Practice for wrapping C include files
Brought to you by:
theller
|
From: Thomas H. <th...@ct...> - 2008-04-30 16:51:08
|
Patrick Moore schrieb: > Hi All, > > I'm finally getting round to wrapping a set of C include files which point > across to a couple of libraries. I'm not very familiar with ctypes and the > surrounding paraphernalia and I'm curious about the best practices for > making the code accessible within python. > > I had a look at h2xml and xml2py, but this seems to generate some errors > -- a lot of the xml files end up being the same size (193698 bytes). I'm > fairly sure that Im making silly mistakes here, but all suggestions are > welcome. Errors are shown below! For the current h2xml and xml2py tools in svn, you should use gccxml version 0.7 not the newest one. They changed quite some things for compatibility with the newer (4.x ?) gcc, but the codegenerator in ctypeslib does not understand the new xml output. > Should I also just pull all the different files within the include > directory into one .py file, with references to the libraries or is it best > to maintain the structure between thepython and c environments? You could probably look into some projects using ctypes; larger ones are pyglet and PyOpenGL. Thomas |