Page 377 - Ai_417_V3.0_C9_Flipbook
P. 377

After the setup progress is complete, the message "Setup was successful" will be displayed. Now, Python is
                 available in your Start menu and also as a shortcut on the desktop. When you open Python, the Python IDLE
                 shell window opens. IDLE stands for Integrated Development and Learning Environment. It is a code editor that
                 helps you write and execute Python programs in the editor itself.










                                                                Python IDLE




                               Brainy Fact

                      Many big companies, like Facebook, Google, NASA, MIT, Nokia, IBM, and many more, use Python
                      for their products and services.




                         Working in Python


                 IDLE is the standard, most popular Python development environment. It allows you to write, edit, run, browse
                 and debug the Python programs from a single interface.
                 We 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. This mode will not save
                   your commands and outputs and should be used only when you want to play with small one-line instructions.
                   You can also use the print( ) function to print the messages on the Shell window.















                                                               Interactive mode
                    • Script Mode (Editor): In this mode, you save all your commands together in any text editor with the extension
                   .py. When we 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.





                                                                                        Introduction to Python  375
   372   373   374   375   376   377   378   379   380   381   382