Getting Python running is simpler than PHP — no separate development server is needed, since Python isn't inherently a web technology. You just install it and run files directly.
Download Python from python.org/downloads (Windows/macOS), or install it through your system's package manager on Linux (apt install python3 on most distributions). Once installed, confirm it from a terminal:
python3 --versionpython vs. python3
On Windows, the command is often just python rather than python3. Either way, confirm you're running Python 3 — Python 2 reached end of life in 2020 and none of this section applies to it.
Typing python3 alone (no filename) opens an interactive prompt where you can try code one line at a time and see the result immediately — extremely useful for quickly testing an idea:
$ python3
>>> 2 + 2
4
>>> print("Hello!")
Hello!
>>> exit()Create a file named hello.py:
print("Hello, world!")Then run it from a terminal in the same folder:
python3 hello.pyUnlike PHP, there's no special opening tag needed — a .py file is Python from the very first line.
A proper editor helps early
Most real Python development happens in a code editor with Python support (VS Code's Python extension is the most common choice) rather than a plain text editor — it catches obvious mistakes as you type instead of only when you run the file.