ctypes help

Python python at bladeshadow.org
Fri Nov 17 22:23:13 EST 2017


On Sat, Nov 18, 2017 at 10:49:40AM +1100, Chris Angelico wrote:
> On Sat, Nov 18, 2017 at 9:11 AM, Python <python at bladeshadow.org> wrote:
> > Hello Pythonistas,
> >
> > I'm starting to play with ctypes, as I'd like to provide Python
> > interfaces to a C/C++ library I have.  For now I'm just messing with a
> > very simple piece of code to get things sorted out.  I'm working with
> > this example C++ library, which just wraps a call to stat():
> 
> I would recommend you look into Cython, which can help you write C
> code that links to Python without all the hassle of manually tracking
> refcounts etc. (I also recommend using Python 3 instead of Python 2,
> but that's a separate point.)

Cython looks interesting, but none of your suggestions are options in
my situation.




More information about the Python-list mailing list