C++ callback with python through SWIG when the function takes non-trivial arguments? -


i read following section of "swig , python" tutorial: http://www.swig.org/doc1.1/html/python.html#n11

i understand in example, write c function calls python. however, example provided takes double in argument list, making rather trivial build argument list python.

i have c++ callback has following signature:

vector (*callback)(simulation*, vector, vector, double, void*) 

where vector , simulation own classes, , void* clientdata holding pyobject (as used in example)

i know swig wraps both vector , simulation classes, because can create them in python shell. problem is, have no idea how transform vector argument in callback function appropriate pyobject python argument list. swig has way when wraps class itself, don't know how accomplish manually in function.

any appreciated! -chase

i not think question swig; purely python. @ level, problem calling in python c, need study "parsing arguments , building values" in python documentation. (also "extending , embedding python interpreter".)


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -