2

So if I have a function:

void foo(void(*fn)()) {
  fn();
}

Which I've added to my Boost.Python module:

boost::python::def(&foo);

Is there any way I can make something like this work in my python script:

def my_fn():
  print 'hello'

foo(my_fn)
Sam Kellett
  • 1,277
  • 12
  • 33
  • Unsure about it, but try this: [Passing Python function to Boost C++](http://stackoverflow.com/questions/21451863/passing-python-function-to-boost-c). – YiFei Aug 13 '16 at 13:53

0 Answers0