python -i (interactive environment)

Reinhold Birkenfeld reinhold-birkenfeld-nospam at
Sun Mar 6 23:27:01 CET 2005

Michael Hoffman wrote:
> Joe wrote:
>> Are there any differences between that and the actual interactve prompt that 
>> I should be aware of?
> I don't know, unfortunately.
>> Would you consider that a better method than using (thanks to those who 
>> suggested this other option):
>> import os
>> os.environ['PYTHONINSPECT'] = '1'
> Actually I would do that everyone else suggested for your use case. I thought
> about trying this method but couldn't imagine that it would actually work!

Actually, using this behavior is encouraged by the developers. See this
comment in Modules/main.c:

   /* Check this environment variable at the end, to give programs the
    * opportunity to set it from Python.


More information about the Python-list mailing list