Using Python

In this lesson we learn that writing programs in an editing window is easier than writing in the Python Shell window.

You can't save your work in the Python Shell and you can't go back and fix something after you press enter in the Python Shell.

Writing your program in an editing window means that you can change your program and run it over and over again.

You can also save your program in a file so you can come back and run it later.

When you write a program in an edit window it doesn't run each line as you enter it. You run the whole program after entering it. But, you can still write a little and then run it to see what it does. The output still appears in the Python Shell.

Saving Your Program

We can write a program in the Python Shell like we did in the last program, but we can't fix mistakes and we can't save it. To be able to save it we want to create an edit window. To start this lesson start IDLE like you did in the last lesson, but then go to menu item File-> New Window. A new window like this will appear on the screen.

You Try It

You can type this program into the window that appears and then save it in one of your folders. Once you have saved it you can run it by pressing F5 or by selecting Run->Run Module from the IDLE menu.

>> Next Lesson