PYTHONSTARTUP and the -i command line option

Peter Hansen peter at engcorp.com
Thu Jun 2 12:55:11 EDT 2005


Christopher Wood wrote:
> But these two things won't play together, as (by design, it seems) 
> $PYTHONSTARTUP isn't read when the -i option is used, leaving me with an 
> unenhanced Python interpreter environment after after script execution.
> 
> Is the any way round this, other than editing all my scripts or manually 
> loading the .pythonrc.py script in the interpreter?

Modifying the contents of your .pythonrc script and therein setting the 
PYTHONINSPECT environment variable via os.environ comes to mind.

-Peter



More information about the Python-list mailing list