[Newbie] embed c++ in Python
Fernando Pérez
fperez528 at yahoo.com
Mon Apr 1 12:40:43 EST 2002
Matthias Stern wrote:
> Hi!
>
> I'm new to Python and I'm looking for a good tutorial how to embed a C/C++
> function into Python. I found some tutorials but no one describes what I
> need:
>
> I want to know how to write a function which receives some variables as
> argument changes them and sends the results back to Python. E.g.:
>
> int doSomething(int *a, int *b) {
> :
> *a = 10;
> *b = 123;
> :
> }
>
> Can I do this in Python? I'd like to call the function doSomething() from
> Python and receive the changed values a and b in Python again.
>
> Is there a tutorial? Has someone got a simple example for this?
>
> Thx, Mac
The easiest of the many possible ways to do it:
http://www.scipy.org/site_content/weave
f.
More information about the Python-list
mailing list