Part 1 of 6 · Chapter 2 of 4

Setting Up Without the Ceremony

The usual first step in a Python tutorial is an hour of installer screenshots. Run one line without installing anything, and see the same interpreter everyone else is using.

Beginner8 min read

The usual first step in a Python tutorial is an hour of installer screenshots. Most of that hour is unnecessary — check what is already on your machine before you install anything.

The one thing you actually need

You need exactly one thing to start: a working Python interpreter you can reach from a terminal. You do not need an editor with plugins, a virtual environment, or a project folder yet — those matter later, once you have more than a few lines to organise.

Check what you already have

Most Mac and Linux machines ship with Python already installed. Pick what you are sitting at.

Terminal
$ python3 --version# Python 3.12.x $ python3

If that version line printed, you are done — skip ahead. If it said “command not found”, install Python 3 from python.org and run it again.

A terminal that already has it

Typing python3 (or py on Windows) with nothing after it drops you into the interactive interpreter, usually called the REPL — read, evaluate, print, loop. Type an expression, press return, and it is evaluated immediately.

REPL
$ >>> 2 + 2$ 4$ >>> "hello".upper()$ 'HELLO'

Everything after the >>> was typed by you. Everything on the line below it is Python printing the result back, unprompted — the REPL shows you the value of every expression you enter, which is why it is the fastest way to check a small idea.

Where a file stops and a script begins

The REPL is for trying something out. A .py file is for keeping it. Save a few lines in a file named hello.py, and run the file itself rather than typing its contents by hand:

hello.py
print("Hello, world!")
Terminal
$ python3 hello.py$ Hello, world!

Nothing you type into the REPL is saved anywhere once you close it. Every program in the rest of this track assumes you are working in a file, not the REPL, for exactly that reason.

Key takeaways

  • You need one thing to start: a Python interpreter reachable from a terminal.
  • The REPL (python3 with nothing after it) evaluates expressions immediately and shows you the result.
  • Nothing typed into the REPL is saved — real programs live in .py files.
  • Run a file with python3 <filename>.py, not by retyping its contents into the REPL.