Can I load a python program at the interactive >>> prompt?

Brian Blais bblais at
Fri Dec 5 16:37:37 EST 2008

On Dec 5, 2008, at 15:52 , walterbyrd wrote:

> Can I load a file into the python interactive environment?  For
> example I have a file called that consists of the following:
> print "hello"
> print "hello again"
> Can I load that file into python at the >>> prompt?
>>>> load ""
> or something like that?

I think you mean:


that should work.  if you have iPython, which is a great shell for  
running python code, you can do:


as far as copy/paste, I think in Windows Python runs in a DOS prompt,  
so you should be able to right-click and choose Edit/Paste.  Not too  
convenient, but I think it works.


Brian Blais
bblais at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list