Page 405 - ComputerScience_Class_11
P. 405

12.4.1 IDLE
                 Integrated Development Learning Environment (IDLE) is the default IDE that comes automatically when Python is
                 installed on a computer. It provides a simple and easy-to-use environment for writing and running Python programs.
                 IDLE includes a basic text editor and an interactive Python shell, where you can type Python commands and see the
                 output immediately. It also highlights syntax errors and supports basic debugging. You can interact with Python IDLE
                 in two different modes:
                 •  Interactive Mode (Python IDLE-Shell Mode): In this mode, you type one command at a time in front of the Python
                   command prompt (>>>) and Python gives you the result based on the command given. It means you run code
                   directly on shell mode accessed through the terminal of an operating system. Commands entered in the Shell are
                   not saved automatically. Therefore this mode is mainly used for quick testing or learning simple commands. The
                   print() function can also be used to display messages in the Shell window.

















                 •  Script Mode (Editor): In this mode, you save all your commands together in the text editor with the extension .py.
                   When you run this text file .py then the output of the commands will be displayed in Shell mode.
                 The steps to write and save a program are as follows:

                 Step 1:  Open the Python IDLE window.
                 Step 2:  Click on the File menu. A drop-down menu appears.
                 Step 3:  Click on the New File option.
                         A new editor window with a blank file will appear on the screen.




















                 Step 4:  Type the program code in Python window.
















                                                               Installation & IDE and Fundamentals of Python Programming  403
   400   401   402   403   404   405   406   407   408   409   410