Another thing which may be important to note re: my constraints is that each script is essentially being run as a function.
In fact, every script element I parse in XML gets wrapped in a function def before I send it to Py_CompileString. I then PyEval the result of that function, and then run Py_CompileString again, passing only the automatically generated function call. The result of the second Py_CompileString is what I pass to PyEval_EvalCode whenever my app needs to run that script (function). -- http://mail.python.org/mailman/listinfo/python-list