How to Run Python Interactive Shell in Microsoft Windows

Posted on

Introduction

In this article, the main content will be just as simple as showing how to run python interactive shell. The process for showing how to do it exist in a local device running using Microsoft Windows operating system. Before going after to the actual execution, there are several preparations which is very important in order to do that. There is a requirement for runing the python interactive shell in the Command Prompt or in the Command Line Interface.

First of all, there must a Python interpreter tool or simply just the Python tool. Check How to Install Python in Microsoft Windows, How to Install Python 3.10 in Microsoft Windows and also How to Install Python in Microsoft Windows 11 for information on how to install it.

How to Run Python Interactive Shell in Microsoft Windows

After ensuring that there is a Python tool or a Python interpreter tool exist in the device, just do or perform the following sequence of process :

  1. In order to execute the python interactive shell, it require a Command Line Interface. In the context of a device running using Microsoft Windows operating system, the Command Line Interface will be the Command Prompt. So, just run the Command Prompt. The following is the appearance of the Command Prompt execution :

    Microsoft Windows [Version 10.0.22000.1219]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\Users\Personal>
    
  2. Next, after getting the Command Prompt running, just type the ‘python’ as the command for running the Python interactive shell as follows :

    Microsoft Windows [Version 10.0.22000.1219]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\Users\Personal>python
    Python 3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 
    

    The above command for typing ‘python’ in the command actually trigger an output by showing a Python interactive shell command prompt. It is where the python syntax will be possible to run in the further execution.

  3. So, next step will just test the Python interactive tool by typing a certain python syntax. Below is an example for ensuring or testing the Python interactive shell as follows :

    >>> help(print)
    Help on built-in function print in module builtins:
    print(...)
    print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
    
    Prints the values to a stream, or to sys.stdout by default.
    Optional keyword arguments:
    file: a file-like object (stream); defaults to the current sys.stdout.
    sep: string inserted between values, default a space.
    end: string appended after the last value, default a newline.
    flush: whether to forcibly flush the stream.
    
    >>>

Leave a Reply