Python Programming for Raspberry Pi, Sams Teach Yourself in 24 Hours

(singke) #1
FIGURE 3.9 A Python script opened in IDLE.

Now, to run the Python script, in the Python script’s window, press the F5 key, or click Run in the
menu bar and then Run Module. The control switches to the originally opened IDLE window (the
IDLE interactive mode window), and the results of the Python script are displayed, as shown in
Figure 3.10.


FIGURE 3.10 A Python script executed in IDLE.

Watch Out!: Where Is My Script Output?
When you first start using IDLE, you might be confused about where the output of the
Python script you are running is displayed. Just remember that output is always
displayed in IDLE’s main interactive mode window. This window has the words
“Python Shell” on the title bar. This is true whether you are running a script or entering
Free download pdf