On 17/07/2006 6:47 AM, [EMAIL PROTECTED] wrote:
> Could anybody tell me how to call python modules from C.
>
> e.g. my Python module :
> def add(a,b)
> return(a+b)
>
> How can I call "add.py" from C? Please post any simple example.
I've never contemplated embedding before, but have done
Could anybody tell me how to call python modules from C.
e.g. my Python module :
def add(a,b)
return(a+b)
How can I call "add.py" from C? Please post any simple example.
I have read Python embedding in Python Manual but I get "ImportError"
all the time?
Any help would be appreciated !
[EMAIL PROTECTED] wrote:
> I am a newbie to Python. I want to call python functions from C. I
> looked for examples but I couldn't get any simple one. Lets say my
> python code is :
> def add(a,b)
> return (a+b)
>
> I want to call add from C. Could anybody please help me? Thanks in
> advance
Thanks Ronny,
R.
Ronny Mandal wrote:
> On 9 May 2006 10:05:48 -0700, [EMAIL PROTECTED] wrote:
>
> >I am a newbie to Python. I want to call python functions from C. I
> >looked for examples but I couldn't get any simple one. Lets say my
> >python code is :
> >def add(a,b)
> > return (a+b)
> >
Thanks Farshid,
Thats helps me alot !
R.
Farshid Lashkari wrote:
> [EMAIL PROTECTED] wrote:
> > I want to call add from C. Could anybody please help me?
>
> Look at the "Pure Embedding" section of the python documentation. It
> contains an example program that does exactly what you want. Here i
On 9 May 2006 10:05:48 -0700, [EMAIL PROTECTED] wrote:
>I am a newbie to Python. I want to call python functions from C. I
>looked for examples but I couldn't get any simple one. Lets say my
>python code is :
>def add(a,b)
> return (a+b)
>
>I want to call add from C. Could anybody please help
[EMAIL PROTECTED] wrote:
> I want to call add from C. Could anybody please help me?
Look at the "Pure Embedding" section of the python documentation. It
contains an example program that does exactly what you want. Here is a
link to the page:
http://www.python.org/doc/ext/pure-embedding.html
-F
I am a newbie to Python. I want to call python functions from C. I
looked for examples but I couldn't get any simple one. Lets say my
python code is :
def add(a,b)
return (a+b)
I want to call add from C. Could anybody please help me? Thanks in
advance.
R.
--
http://mail.python.org/mailman/