Extreme Newbie Question

Greg Ewing greg.ewing at compaq.com
Sun Jul 25 18:20:42 EDT 1999


Robert Zurer wrote:
> 
> In interactive mode how do you save the script that you've entered line
> by line to a file?

You don't. Interactive mode isn't really designed to
be used that way -- it's more for throwaway experimentation.

If you're developing a script, it's best to enter it
into a file right from the beginning. This is very
easy if you're using IDLE. Just open up a new window,
type in some code, save, and hit F5 to run it. Check the
output, tweak, rerun, repeat as necessary.

If you're not using IDLE, you can do much the same
thing with a text editor and a shell window side by
side. Enter your code in the text editor, and use
"python myscript.py" or whatever in the shell window
to run it.

Hope that helps,
Greg




More information about the Python-list mailing list