A question about Python's API

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gary Herron

    A question about Python's API

    Hello python-list,

    A student trying to embed Python into a game engine seems to have
    uncovered the following oversight of Python's API,

    There is a function named Py_CompileStrin g which produces a code
    object from a string, but we can't find a a function in the published
    API to execute that code object.

    There is a function named PyEval_EvalCode which looks like the right
    thing to use, but it's not part of the published API, and it's
    definition is not included when one #include's Python.h.
    Nevertheless, I've suggested that he #include eval.h and try calling
    the function to see if it is what he wants.

    So ... Is this our oversight, and there really is something in the
    API to execute the code object returned by Py_CompileStrin g, or should
    the API be enhanced to include PyEval_EvalCode or something similar?

    Thanks,

    Gary Herron






Working...