I have a python function:
def log(text):
print text
saved in Callbacks.py file. Now I want to import it to c++ function and execute. This works fine:
py_fun = import("Callbacks");
py_fun.attr("log")(text);
But I would like to make log function part of a class:
class Logger:
def __init__(self):
self.last_read = -1
def log(self, text):
print text
How can I import it to C++ and create an instance of Logger?