InterpContext

Encapsulate a context within the Python interpreter.

This will preserve local variables and changes to the Python interpreter made by 'from ___future__ import feature' across calls to this.py_eval and this.py_stmts.

Otherwise, will not segregate global changes made to the Python interpreter.

Constructors

this
this()

Members

Functions

py_eval
T py_eval(string python, string file = __FILE__, size_t line = __LINE__)

Evaluate a python expression once within this context and return the result.

py_stmts
void py_stmts(string python, string file = __FILE__, size_t line = __LINE__)

Evaluate one or more python statements once.

Variables

globals
PydObject globals;

dict object: global variables in this context

locals
PydObject locals;

dict object: local variables in this context

Meta