Re: C Python: Running Python code within function scope

2012-09-04 Thread Terry Reedy
On 9/4/2012 4:28 PM, channel727...@gmail.com wrote: The Python C API function PyEval_EvalCode let's you execute compiled Python code. I want to execute a block of Python code as if it were executing within the scope of a function, so that it has its own dictionary of local variables which don't a

C Python: Running Python code within function scope

2012-09-04 Thread channel727272
The Python C API function PyEval_EvalCode let's you execute compiled Python code. I want to execute a block of Python code as if it were executing within the scope of a function, so that it has its own dictionary of local variables which don't affect the global state. This seems easy enough to