[C++-sig] [boost python] : how to pass a tuple of lists from python to C++

HOUSSEN Franck fghoussen at gmail.com
Fri Feb 7 16:06:27 EST 2020


With boost python, how to pass a tuple of lists from python to C++ ? Code
attached : line 12 crashes ?! Googling but no fix for now.

Expected results should look like this:
>> make; python dummyTest.py
g++ -I/usr/include/python2.7 -o dummy.so -shared -fPIC dummy.cpp
-lboost_python -lboost_numpy
doStuffs
nbInt 3
ptrInt ......
ptrInt[0] = 1
ptrInt[1] = 2
ptrInt[2] = 3
nbfloat 3
ptrFloat ....
ptrFloat[0] = 1.2
ptrFloat[1] = 2.3
ptrFloat[2] = 3.4

-- 
Bonne journée,

Franck HOUSSEN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20200207/cd682702/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dummyTest.py
Type: text/x-python
Size: 191 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20200207/cd682702/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 100 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20200207/cd682702/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dummy.cpp
Type: text/x-c++src
Size: 1041 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20200207/cd682702/attachment.cpp>


More information about the Cplusplus-sig mailing list