PYTHONSTARTUP ignored by python -i file.py?

Huaiyu Zhu hzhu at users.sourceforge.net
Wed Sep 13 21:58:43 CEST 2000


Here's a simple thing that has bugged me for a while.

I want to do something like

python -i file.py

and get the effect of 

python
>>> from file import *

However, it appears the .pythonrc in my $PYTHONSTARTUP is not read (which
does the readline, command completion and history recall stuff).

How do I achieve both results (.pythonrc and file.py) with one command line?

(No, file.py cannot be put into .pythonrc because it is not used every time.
And no, file.py cannot import .pythonrc because it is used by different
people in different environments.)


Huaiyu
-- 



More information about the Python-list mailing list