1

Possible Duplicate:
Calling Python functions from C++

I'd like to make Python binding in my application using boost::python library. After reading documentation I realized it's quite simple to make a new object with functions that will call C++ functions. Although, I'd like to make something different.

Let say I have a function that triggers when player uses an item in-game, I'd want it to call a Python file which would look like:

def onUse(player, item, position): //my code here

How would I make it using boost::python? I mean, how would I create an 'onUse' function with pre-defined parameters and how would I make my C++ function to call the 'onUse' in Python file?

Community
  • 1
  • 1
Diath
  • 11
  • 4
  • 1
    If you want to call a python function from c++ see: http://stackoverflow.com/questions/4331599/calling-python-functions-from-c/4337552#4337552 – Matthew Scouten Apr 16 '12 at 02:09

0 Answers0