Loading a file into the interpreter
Erik Max Francis
max at alcyone.com
Mon Aug 18 02:47:12 EDT 2003
Thomas Womack wrote:
> I'd like, from the command line of the python interpreter, to get the
> effect of having typed in the contents of some text file; the sort of
> thing I'd expect a "load" command to do.
>
> I can do "python prog.py", but that doesn't leave me in the
> interpreter afterwards, and I'd often like to set some variables, load
> a program, and poke about to see what the variables look like
> afterwards.
Try
python -i prog.py
--
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ Well I have been puppetized / Oh how I have compromised
\__/ Lamya
More information about the Python-list
mailing list