Codectionary / Developer documentation / Python

Install an official Python runtime, check which interpreter runs, and execute a saved Python file from PowerShell.

Install the Python Install Manager

Instructions checked 18 October 2026 against the official documentation linked below. Menu labels may differ between releases; verify the selected interpreter rather than relying only on its display name.

This guide follows the current Python 3.15 Windows documentation and the Python Install Manager on a supported Windows installation. Check the download’s system requirements before installing. On a managed work or school computer, use the approved software process; the Playground can edit Python, but running it there is temporarily paused.

  1. Open the official Python downloads page below and select the Python Install Manager, or its official Microsoft Store listing. Avoid the embeddable package for a first learning installation.
  2. Install the manager, then open a NEW PowerShell terminal. Existing terminals may retain the old PATH.
  3. Run the commands below. pymanager unambiguously addresses the new manager if an older py launcher is also installed. Installing a runtime requires an internet connection.

PowerShell — install a runtime and verify

pymanager install 3.15
pymanager list
python --version
python -c "import sys; print(sys.executable)"

Save and run a script

Create a folder called python-practice in a location you can write to. Open it in your editor, create hello.py, and enter print("Hello, Python!"). Save it as plain text with the .py extension, not hello.py.txt. Open a terminal in that folder; the commands below run the saved file, not unsaved editor changes.

Use cd followed by your folder’s path to move there; quote paths containing spaces. Run the command below and expect Hello, Python! once. Terminal commands belong at the PowerShell prompt, not at Python’s >>> prompt. Use exit() to leave the Python shell.

PowerShell — inside python-practice

python hello.py

If it does not work

If python opens the Store or is not found, reopen PowerShell and check the manager’s troubleshooting page for App execution aliases and PATH. Use where.exe python to inspect command resolution. Do not delete an existing installation simply because two versions are listed.

If python and your editor report different versions, select the intended interpreter in the editor. The path printed by sys.executable is the useful evidence. A legacy py launcher does not understand every new manager subcommand; use pymanager for manager operations.

“Cannot open file” usually means you are in the wrong folder or saved hello.py.txt. Check the filename and directory. A window that closes immediately after double-clicking a file is another reason to run it from a terminal.

Syntax

print("Hello, Python!")

Examples

Your first Python program

Save as hello.py in your project folder. Expected output: Hello, Python!

print("Hello, Python!")
  1. print is a built-in function that writes to the output stream.
  2. The quoted text is a string. The quotes are not printed.
  3. Parentheses pass that string to print. No extra package is required.

Best practices

  • Save your work before running it, and check the output after each small change.
  • Keep your learning project in its own folder. Do not name files after standard modules such as random.py or json.py.

Runtime & versions

Python interpreter. Feature availability depends on the language and runtime version used by your project; consult the official reference below.

Python language reference

Specifications & further reading