Starting Python in Different Execution Modes in Windows

 Starting Python in Different Execution Modes

After installing Python in Windows, you can start Python in two different modes, viz. Python (Command Line) and Python (IDLE).



Starting Python (Command Line)

Python is an interpreted language. You can directly write the code into the Python interpreter or you can write a sequence of instructions into a file and then run the file.

    When you execute Python expressions or statements from the command line then you are in interactive mode or interactive prompt.

Steps for writing a Python command line in Windows 7 are above are given as follows:

STEP 1:   Press the Start button


STEP 2:   Click on All programs and then Python 3.9. After clicking on Python 3.9 you will see a list options as shown in figure.


STEP 3:   In this list click on Python (Command Line -- 32 bit). After clicking on it, you will see the Python interactive prompt in Python command line as shown in figure


    In figure the Python command prompt contains and opening message >>>, called command prompt. The cursor at the command prompt waits for you to enter a Python command. A complete command is called a statement. Simple commands executed in the interactive mode of Python command line are shown in Figure.


   We have written two simple commands or statements. The first statement, i.e. print('Hello World') when executed in the interactive mode of Python command prompt gives the output as the entered command, i.e. 'Hello World' for this message. More details about print and its syntax are explained in upcoming blogs.

   Precautions to be taken while executing commands in the interactive mode of Python with command line are given as follows. 




   To exit from the command line of Python 3.9, press Ctrl+z followed by Enter.

Comments

Popular posts from this blog

Python Implementations