[Q] How Can I call python function from C source?

Kim Chul Min cmkim at shinbiro.com
Thu Jun 27 00:17:25 EDT 2002


Hello there,

I want to call python function from c source.

for example,

in file "main.c"
--------------------------------------------------------------
int main(void)
{

    /** want to call python function add(a,b) that return a+b **/

}
--------------------------------------------------------------

in the file "add.py"
--------------------------------------------------------------
def add(a,b):
    return(a+b)
--------------------------------------------------------------

Can I call any function that written by python from C source ?

If possible, can anyone show me simple example like above??

Plz,,, Help me....Thankx in advance...

Ciao,
Farangan Xavio
cmkim at shinbiro.com







More information about the Python-list mailing list