PyRun_String("random.randint(1,10)", Py_eval_input, globals, globals);
returns error with:
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'random' is not defined
earlier in the code, I did:
PyImport_ImportModule("random");
I guess this is not the way to get it work. What is the correct way? Thank you!