Start the interactive shell within an application

Robert Kern robert.kern at
Tue Jun 9 21:27:05 CEST 2009

On 2009-06-09 03:49, Jean-Michel Pichavant wrote:
> I was wondering if there is a way to start an interactive shell within a
> script/application.
> I'm sometimes tired of adding prints to scan the current namespace so
> I'd like to pause the execution and give the user the shell prompt.
> This is obviously for debugging purpose.
> I know that I may use the raw_input and eval the captured text but
> honestly, this requires some coding and I won't benefit from the shell
> features. Would it be even possible to use a shell like Ipython ?

> By the way, if anyone has cunning ways for debugging code to share, he
> would be much welcome.

You would do well to learn to use the standard Python debugger:

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

More information about the Python-list mailing list