How is it possible to access a python module in C++?
问题 I'm trying to import a module in C++. the module resides in a package and should be accessed like: from x.y import class1,func1, const1, etc I'm on Python3.6 and for this version what I have found so far is to use PyRun_SimpleString to do the import and then use PyImport_AddModuleObject to have a handle to my module. that is: PyRun_SimpleString("from PacKage1 import Module1 as Module1"); auto module = PyImport_AddModuleObject(PyUnicode_DecodeFSDefault("Module1")); so that down the road I can