C API: Getting PyObject by name

pbienst Peter.Bienstman at UGent.be
Thu Sep 30 20:47:00 CEST 2010


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!


More information about the Python-list mailing list