[Tutor] How to make a python binding for a c library?

Alan Gauld alan.gauld at btinternet.com
Tue May 13 19:56:26 CEST 2008


"tuyun" <twomol at hotmail.com> wrote 

> I have a library written in C, I want to 
> make a python binding for it.

If on Windows and a DLL then ctypes is probably 
the best bet.

If a simple object file on *nix then you might 
try SWIG, the basic tutorial there is quite good.

There are lots of HowTo articles on this topic 
however so you should find plenty explanation 
for doing it from the ground up.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld



More information about the Tutor mailing list