Interactive startup file

Brendhan Horne brendhanhorne at bellsouth.net
Sat Mar 17 20:13:35 EST 2001


> Well, it's exactly what it says.
>
> If you set environment variable

Go slow here, What is an environment variable?


>     PYTHONSTARTUP='.pythonrc'
> then commands in file '.pythonrc' will be executed everytime you run
> python in interactive mode (ie. when you get '>>>' prompt).  For
> example, mine contains
>     import rlcompleter
>     rlcompleter.readline.parse_and_bind('tab: complete')
It sounds kinda like a program that runs everytime you start the command
interpretter>>>>  Am I correct?
>
> If you want to run those commands from a script, then you have to call
> the file explicitly, using
>     execfile('.pythonrc')
If I am at the command interpretter>>>> I can open a file from there by
typing:
>>> execfile('.filenamehere')    and it would open the file?

--
Thanks,
Brendhan





More information about the Python-list mailing list