Re: Calling C++ function from python script

2006-01-28 Thread Pankaj
One small thing was incorrect there. gcc -c TestCase.c TestCase_wrap.c -I /usr/include/python2.2/ This include path is required for Python.h file -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling C++ function from python script

2006-01-28 Thread Pankaj
See, i tell u, nothing is difficult in this world. I achieved the thing which i was asking for. Thanks for the advice. I used this paper: http://www.swig.org/tutorial.html for creating python modules from C code. Which is what i needed. In order to interface both things, we need convert atleas

Re: Calling C++ function from python script

2006-01-28 Thread Ravi Teja
Right. They are complicated(Assuming that you are reading Python API docs), especially if you have not done a substantial amount of C. You spent 8 minutes trying to understand them. What did you expect? People spend days sorting out the API issues. If you are in a hurry, Pyrex is easiest approch t

Re: Calling C++ function from python script

2006-01-28 Thread Pankaj
The examples given are too complicated. So, if it can be explained using my sample example. Would be thankful for that. /* 1.c File **/ func( char a[10] ) { int i; for( i =0; i < 10; i++) printf("\n array element is: %c", a[i]); } /* 1.py File **/ f = o

Re: Calling C++ function from python script

2006-01-28 Thread Ravi Teja
Extending -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling C++ function from python script

2006-01-28 Thread Pankaj
In my case, i want to use python script as parent script and call C++ function from within the python script. If this is the case, then what am i doing? 1. extending 2. embedding. ? Ravi Teja wrote: > Pankaj wrote: > > The module which i am creating is like > > > > Part A: > > 1. It does some

Re: Calling C++ function from python script

2006-01-28 Thread Ravi Teja
Pankaj wrote: > The module which i am creating is like > > Part A: > 1. It does some processing by using python code. > 2. The result of this python code execution is written to a text file. > [This part is already compelete]] > > Part B: > 1. I read a text file which is outputted by above python

Calling C++ function from python script

2006-01-28 Thread Pankaj
The module which i am creating is like Part A: 1. It does some processing by using python code. 2. The result of this python code execution is written to a text file. [This part is already compelete]] Part B: 1. I read a text file which is outputted by above python script in a C++ program 2. and