Starting a script interactively?
peter at engcorp.com
Tue Jan 6 14:34:32 CET 2004
David Klaffenbach wrote:
> Is there a way from within a python script to cause the interpreter to
> be in interactive mode after the script finishes?
Added in Python 2.3, according to http://www.python.org/2.3/highlights.html:
PYTHONINSPECT - A program can now set the environment variable $PYTHONINSPECT to
some string value in Python, and cause the interpreter to enter the interactive
prompt at program exit, as if Python had been invoked with the -i option.
In other words, this should work:
os.environ['PYTHONINSPECT'] = '1'
More information about the Python-list