Page 51 - Information_Practice_Fliipbook_Class11
P. 51
To save the file, again click on the menu bar, follow the click sequence <File>-><Save As> and select the folder where
you want to save the file and choose a suitable name for the file. We have saved the file as 'F:/CBSE/class11/
ch5/welcome.py'. The saved script can be executed now or later.
Fig 2.6: Python Script
To execute a saved file, on the IDLE's menu bar, click on the <File> menu to open an existing file, say, 'F:/CBSE/
class11/ch5/welcome.py'. Once the file is opened, on IDLE's menu bar, follow the click sequence RUN-> Run
Module(F5), and the result of executing the Python script will be displayed in IDLE Shell, as shown in Fig 2.7:
Fig 2.7 Result of executing the Python script
Instead of the click sequence RUN-> Run Module(F5), we could also use the short key <F5> (<ctrl> <F5> on some
systems). On pressing the key <F5>, IDLE executes the current script if the current version of the script is already saved.
However, if the script is not already saved, IDLE prompts the user to save the script, as shown in Fig 2.8.
Fig 2.8: IDLE's prompt to save the script
Once the script is saved, it is executed by IDLE, and the result is displayed in the IDLE's Shell. Congratulations! You have
implemented the first Python program successfully.
Having already dealt with text, let us evaluate some numerical expressions in the Python shell (see Fig 2.9).
Fig 2.9 Evaluating numerical expressions in Python Shell
Getng Started with Python Programming 37

