[C++-sig] a question about boost python
roman.yakovenko at gmail.com
Tue Oct 16 12:23:55 CEST 2007
On 10/16/07, Chang Chen <Chang_Chen at sonic.com> wrote:
> Hi All
> I have a set of functions which last parameters are out-parameter. i.e.
> void function1(int t1, float t2, string& t3) ;
> I want to expose these functions in python, but such definition (~def("
> function1", function1)~) is not what I want.
> Because we have to write python code like this:
> I prefer to writing python code like this
> strTest = funciton1(1,2.0)
> Is there any idea to solve this question?
In short: to create another function, with the desired interface. In your
case you just don't have other choice - std::string is mapped to Python
string, which is immutable.
Read more here:
C++ Python language binding
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cplusplus-sig