I have only been able to find tutorials and links for python 2 not any for 3. A lot of functions have changed since 2 and the tutorials no longer work.
I was able to take this from a another Stackoverflow question and it seems to be the closest to working.
char *my_result = 0;
PyObject *module = 0;
PyObject *result = 0;
PyObject *module_dict = 0;
PyObject *func = 0;
PyObject *pArgs = 0;
module = PyImport_ImportModule("testPython");
if (module == 0)
{
PyErr_Print();
printf("Couldn't find python module");
}
module_dict = PyModule_GetDict(module);
func = PyDict_GetItemString(module_dict, "helloWorld");
//result = PyObject_CallObject(func, NULL);
result = PyEval_CallObject(func, NULL);
my_result = PyBytes_AsString(result);
my_result = strdup(my_result);
But the my_result outputs 0000. And when using a breakpoint it says it cannot read the memory.