title: Scripting inside a Python application
body: <p><br/>
  I'd like to include <strong>Python scripting</strong> in one of my applications, that is written in Python itself. </p>
  
  <p>My application must be able to call external Python functions (written by the user) as <strong>callbacks</strong>. There must be some control on code execution; for example, if the user provided code with syntax errors, the application must signal that.</p>
  
  <p>What is the best way to do this?
  <br/>Thanks.</p>
  
  <p><em>edit</em>: question was unclear. I need a mechanism similar to events of VBA, where there is a "declarations" section (where you define global variables) and events, with scripted code, that fire at specific points.</p>