[C++-sig] Reloading Functions

Jared McIntyre Jared.McIntyre at medsimulation.com
Tue Apr 10 21:02:20 CEST 2007

I'm sure this should be answered somewhere, but I'm having problems
hunting it down. I am working to get embedded Python scripting in the
system using boost::python. We already have LUA running. The only issue
I'm having is reloading python functions into the runtime. So, I load
the file initially:


object result = exec_file("C:\\ PythonTest\\HelloFile.py", global,

object greet = global["greet"];


Now I can run greet() just fine. However, we need to be able to make
changes in the greet script while the system is running, and swap the
old with the new. Calling the exec_file again won't replace the function
with the new version. Is there a way to do this without tearing down the
entire python runtime and restarting it?





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20070410/4407f108/attachment.htm>

More information about the Cplusplus-sig mailing list