jump into the interpreter in a script

Fredrik Lundh fredrik at pythonware.com
Thu Feb 9 17:09:45 EST 2006


Carl Friedrich Bolz wrote:

> Yes. The "code" module of the stdlib is what you want. put
>
> import code
> code.interact(local=locals())
>
> into a point where you would like to have an interpreter prompt.

or, as a reusable function:

    http://effbot.org/librarybook/code.htm

(see the third example on that page)

</F>






More information about the Python-list mailing list