python -i (interactive environment)

MikeyG mikewantsnospam at
Sun Mar 6 20:41:06 CET 2005

Joe wrote:
> When you run "python -i" after the script completes you left 
> at the interactive command prompt.
> Is there a way to have this occur from a running program?
> In other words can I just run (NOT python -i 
> and inside of I decide that I want to fall back to the 
> interactive prompt?
> I've searched and so far the only thing I've come up with is to use pdb, but 
> that is not exactly the same as the interactive prompt.
> Is there any way to do it that I have missed?
> Thanks. 

Yes you can set the PYTHONINSPECT environment variable to something 
other than an empty string from within your program.


More information about the Python-list mailing list