C API: Getting PyObject by name

pbienst Peter.Bienstman at UGent.be
Thu Sep 30 14:47:00 EDT 2010


Hi,

I'm embedding Python in a C app.

Say I do the following:

  PyRun_SimpleString("a = 1")

Is there then a way to get access to the PyObject corresponding to a,
only making use in C of the fact that it's called "a"?

I've searched through the API docs, but I couldn't really find what I
was looking for.

Any help most appreciated!

Peter



More information about the Python-list mailing list