execute a function after each source code line ?

Steve Howell showell30 at yahoo.com
Fri Jun 1 06:48:09 EDT 2007


--- "Diez B. Roggisch" <deets at nospam.web.de> wrote:
> > 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
> 

I'm not sure how much that will help in a GUI
event-driven environment like wxPython.  Since the OP
is generating his own Python code, he can insert his
own tracing statements.  

I think the essential problem is how do you run the
intrepreted Python program in a mode that you can have
the GUI get an event, let the intrepreted program run
the next instruction, have the GUI get another event,
have the intrepreted program run to the next
instruction, etc.

There are probably ways to achieve this, such as
running the intrepreted Python program in a thread,
but my own experience in this in wxPython, with Guido
van Robot, led me to believe that it's ultimately
easier to create a virtual machine for your intepreted
language.

But I may be missing your point.





 
____________________________________________________________________________________
Don't get soaked.  Take a quick peak at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather



More information about the Python-list mailing list