how does python invoke an external C function??

Ken Seehof kens at sightreader.com
Thu Jun 15 23:07:22 EDT 2000


That's the easy part.  Same as calling a python function.  If your
function is called "spam" in an extension module called "eggs", you
import eggs and call eggs.spam.

>>> import eggs
>>> eggs.spam()

Probably the question you should be asking is: "How do I write an
external C function?"

I refer you to the "extending and embedding" section of your favorite
python book.  You are interested in "extending" which means "writing a
python module in C".  Warning, this is a somewhat advanced topic, but
easy once you get the hang of it.

Sam Wun wrote: [how does python invoke an external C function?]

> thansk
> Sam.
>
> --
> Sam Wun                            Firewalls / Security
> OneGuard Senior Software Engineer  Electronic Commerce
> eSec Limited                       Phone: +61 3 83715376
> mailto:swun at eSec.com.au            C++/JAVA/UNIX/OOP/OOD
>
--
Ken Seehof
kens at sightreader.com
starship.python.net/crew/seehof
Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20000615/0c191dc2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kens.vcf
Type: text/x-vcard
Size: 343 bytes
Desc: Card for Ken Seehof
URL: <http://mail.python.org/pipermail/python-list/attachments/20000615/0c191dc2/attachment.vcf>


More information about the Python-list mailing list