Page 48 - Computer - 7
P. 48
COMPONENTS OF PYTHON IDLE WINDOW
Let us learn about the components of the Python IDLE window.
Title Bar
Menu Bar
Python
Interpreter
Status Bar
Component Description
Title Bar Displays the version of the Python IDLE and contains the control buttons to
minimise, maximise, and close the window.
Menu Bar Displays menus that contain commands related to a specific set of activities.
Python Interpreter Displays the Python command prompt >>>. Commands are typed at the prompt
or Shell and their results are displayed below the commands.
Status Bar Displays the line number and column number at which the cursor is in the
Interpreter.
Editor Opens in Script mode. Displays the Script Area where code is typed.
WORKING WITH PYTHON IDLE
Let us quickly recap what you have learned about working in Python in the previous class.
Python Working Modes
The two working modes in which the Python IDLE works are:
1. Interactive Mode or Shell Mode : In the Interactive mode, each command is typed at the prompt.
When we press the Enter key, the Interpreter executes the command and displays the result
below the command. The commands are not saved and, hence, cannot be reused. The Interactive
mode can display text messages, results of calculations, and values of variables.
2. Script mode : The Script mode, also known as Batch Processing mode, lets you execute several
Python commands together in a sequence. This is done by saving the set of commands as a file
called a script or program. The saved script can be reused later as required. Once the script is
created, you can execute the script to view the output.
Understanding Variables
Variables are named locations in the memory of a computer where data is stored temporarily. The data
stored in the variables can be manipulated during the execution of a program. Every variable in a script
has a name by which it is referred to during the execution of the script. The rules for naming variables
in Python are:
1. Variable names should be meaningful.
2. Variable names can contain alphabets, digits, and the underscore symbol ( _ ).
3. Variable names must start with an alphabet or the underscore symbol.
46