How does python invoke external C function?

Courageous jkraska1 at san.rr.com
Fri Jun 16 02:23:01 EDT 2000


Sam Wun wrote:
> 
> Hi,
> 
> I would like Python call an external C function ( ie. char
> *getString()),
> Does anyone knows how to do that?

You need to learn how to write a C external module for
python. There is information online at http://www.python.org,
but _Essential Python Reference_ is more thorough. Alternately,
if you're pretty good at C, you might get the python source
distribution and take a gander through a few of the objects.
The first one you should look at is xxobject.c, which is nothing
more than a skeletal implemenation of an external C module from
which you can start your efforts.

For one simple external C function, you should find it pretty
trivial, IMO.




C/



More information about the Python-list mailing list