Verifying Your Python Installation
Now that you've installed Python, let's confirm it's working correctly. We'll do this by checking the Python version and launching the interactive shell.
Opening the Windows Command Prompt
First, you need to open the Windows Command Prompt. There are several ways to do this:
- Press the Windows key, type
cmd
, and press Enter. - Right-click the Windows Start button and select "Terminal" or "Windows PowerShell" (either will work for these commands).
Checking the Python Version
Once the Command Prompt is open, you can check the Python version using one of two commands:
python --version
py --version
Try both commands. The py
command is the Python Launcher for Windows, and it's useful if you have multiple Python versions installed.
Expected Output:
You should see output similar to this:
Python 3.11.4
The exact version number will depend on the version you installed. If you receive an error message like "'python' is not recognized...", it means Python is not in your system's PATH environment variable. (This is covered in a separate tutorial segment.)
Launching the Python Interactive Shell
The Python interactive shell allows you to execute Python code line by line. You can launch it using either of these commands:
python
py
Expected Output:
After running one of these commands, you should see something like this:
Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
The >>>
prompt indicates that you are now in the Python interactive shell. You can type Python code here and press Enter to execute it. For example:
>>> print("Hello, world!")
Hello, world!
>>>
To exit the interactive shell, type exit()
and press Enter, or press Ctrl+Z
and then Enter.
Further Resources
For more information about the Python Launcher for Windows, see the official documentation: Python Launcher for Windows
You can also find helpful information about the Python interactive shell on the official Python website: The Python Interactive Interpreter
Expected Outcome for this step:
User will be able to verify their Python installation and launch the Python interactive shell from the Windows command prompt.
No comments on this specific step yet. Be the first!
(Form to add comment for this step coming soon)