Interactive loop with InteractiveInterpreter

Tim Gahnström /Bladerman tim at bladerman.com
Fri Apr 4 21:14:46 CEST 2003


"Michael Chermside" <mcherm at mcherm.com> wrote

> > If I am about to send a for statement or a while statement to the
> > interpreter I skip that line and set up my own loop with the parameters
from
> > the the loopline and then feed each line to the interpreter several
times,
> > handling the looping myself.
>
> If ALL you have to handle is the code:
>
>     for i in list:
>         print i
>
> Then I think you can probably "set up your own loop". But I hope you
> realize that this doesn't generalize very well. If you had this:

Hmm, yes you are right ofcourse, it actually scales lousy.

> Fortunately, are correct that looking at debugging hooks is the
> way to go for what I _think_ you want. (I think you want an interactive
> display that stops after each "line" of code, right?) Whether or
> not that's done via debuggermodule, I'm not sure, but if you explore
> the docs a little and still have questions, I'm sure others here can
> answer them.

I will have a good look at them, they seem to be much more what I want. I
will probalby post a few questions here :-)

Thanks a lot for your effort!

Tim






More information about the Python-list mailing list