execute a function after each source code line ?

Diez B. Roggisch deets at nospam.web.de
Fri Jun 1 06:27:17 EDT 2007


stef wrote:

> hello,
> 
> doing a simulation of another language (JAL),
> I translate the other language into Python code,
> then I execute this converted Python code.
> 
> Now I need todo some checks and give visual feedback to the user,
> each time a line of code is executed.
> 
> One way of realizing this, is to add a function call at each source code
> line under investigation.
> 
> Are there any other (simple) ways of achieving this ?
> (btw the whole program is running as an graphical (wxPython) application)

use the python trace facilities.

http://docs.python.org/lib/module-trace.html

Diez



More information about the Python-list mailing list