?
=?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=
Hi,
Imagine that you have a PyObject pointer 'object'
pointing to a Python integer ... let's say 42.
How would do you attach the variable "answer" to
it so that the code
PyRun_SimpleString("print answer");
works as expected ?
My current solution is:
__main__ = PyImport_ImportModule("__main__");
PyObject_SetAttrString(__main__, "answer", object);
Anything better ?
SB
Imagine that you have a PyObject pointer 'object'
pointing to a Python integer ... let's say 42.
How would do you attach the variable "answer" to
it so that the code
PyRun_SimpleString("print answer");
works as expected ?
My current solution is:
__main__ = PyImport_ImportModule("__main__");
PyObject_SetAttrString(__main__, "answer", object);
Anything better ?
SB