Re: default environment setup

Guido van Rossum (Guido.van.Rossum@cwi.nl)
Fri, 26 Jun 1992 14:13:59 +0200

>I would like to initialize a dictionary upon invocation of the python
>interpreter . Is there a .python file ?

No, but you can simulate it by typing this at the first prompt:

>>> execfile('.python')

(This assumes the ".python" file is in the current directory.)

The Python interpreter does not automatically read a file of commands
because Python scripts should be independent of their environment, as
much as possible ($PYTHONPATH being the exception).

But if enough people want this, it's easy to add a feature whereby a
command line option (e.g. -f file) specifies a filename to be executed
before reading commands from stdin, or whereby an environment variable
(e.g. $PYTHONSTARTUP) specifies a file that is read by every
*interactive* interpreter.

Or are there any better ideas?

--Guido van Rossum, CWI, Amsterdam <guido@cwi.nl>
"It's not much of a cheese shop really, is it?"