Skip to content
wannacode

Getting your computer ready

Problem

What you need

To write and run programs, you need two things:

  1. Python: the python interpreter that runs programs, and the standard libraries.
  2. An editor for your code. You could write a program in Notepad, but an editor for programmers colors the code, gives you hints and shows errors as you type.

If you do not have a computer you can install programs on yet, an online editor is enough for the first few days: search the web for online Python. The tasks from the "Language basics" module work there too. For the bigger programs later on, you will need an installation.

The idea

Install Python 3.12

We use Python 3.12 or newer (3.13, 3.14): everything in the course runs on them. Download it from python.org, in the Downloads section.

  • Windows: download Python for Windows and run the installer. If it asks whether to add Python to the PATH ("Add python.exe to PATH"), turn the option on.
  • macOS: download the installer for macOS and run it.
  • Linux: Python is usually already on the system (on Ubuntu 24.04 it is 3.12). If it is not there, this is how you install it on Ubuntu:
Terminal
sudo apt install python3

Check. Open a new terminal (on Windows: PowerShell or Command Prompt) and type the first line on Windows, or the second one on macOS and Linux:

Terminal
python --version
python3 --version

You should see the version number. The numbers after 3.12 may be different, and the version may also be newer:

Python 3.12.7

On macOS and Linux the command is python3, because there is often no python command there. Wherever the course says python, you type python3.

The idea

Choose an editor

Two good free options:

  • Visual Studio Code with the Python extension from Microsoft. It is light and works for other languages too. You run the program with the triangle at the top right (Run Python File).
  • PyCharm from JetBrains: an editor made specially for Python. The free version is enough for the whole course. You run the program with the green triangle at the top.

Which editor you choose does not matter much. What matters more is that you get used to one and use it every day.

See it

Your first program on your computer

Make a folder for the course, and in it a file named shop.py with this content:

shop.py
print("Hello!")
Output
Hello!

That is the whole program: one line, with nothing around it. In the terminal, go to the folder (cd and the path to it) and run (on macOS and Linux: python3 shop.py):

Terminal
python shop.py

Python checks the file, translates it and runs it right away. No other file appears in the folder.

More precisely, if you are curious
  • On Windows, the py shop.py command works too. It runs the newest Python that is installed.
  • The python command without a file (python3 on macOS and Linux) opens a mode where you type line by line and see the result right away. It is handy for trying out one line. You leave it with exit().
  • You choose the file name. Do not name it after a Python library (random.py, for example): when the program brings in that library, Python will take your file instead.
  • If the Windows terminal shows question marks or odd symbols instead of characters such as € or é, the terminal is not set up for UTF-8. Type chcp 65001 and run the program again. Editors usually do not have this problem.

Try it

Change it and run it again

Add a second line that prints "Your computer is ready.", save the file and run the program again. You should see:

Output
Hello!
Your computer is ready.

If you see only "Hello!", the file most likely is not saved. Here is the whole program, in case you get stuck:

shop.py
print("Hello!")
print("Your computer is ready.")

Why a change you have not saved does not reach the program:

print("Hello!")
print("Your computer is ready.")
Step by step, in words
  1. The editor and the file on disk both have only the first line.
  2. You run python shop.py: Python reads the file on disk.
  3. You add a second line in the editor. The file on disk is still the old one.
  4. You run it without saving: you still get only "Hello!".
  5. You save (Ctrl+S): the editor writes the text to the file on disk.
  6. You run it again: now the program sees the second line too.

The idea

When it will not start

  • "'python' is not recognized…" (Windows) or "command not found" (macOS, Linux): the terminal cannot find Python. Close it and open a new one, because the old one does not see the changes from the installation. On macOS and Linux type python3, and on Windows try py as well.
  • "Python was not found; run without arguments to install from the Microsoft Store…" (Windows): Windows has its own shortcut named python that sends you to the Microsoft Store. Install Python from python.org or turn that shortcut off: Settings → Apps → Advanced app settings → App execution aliases.
  • "can't open file … No such file or directory": you are running from the wrong folder, or the file has a different name. Go into the folder with shop.py (cd and the path to it).
  • SyntaxError or another message with a line number (line 1): Python has started and read the file, so the installation is fine. Compare your code with the example character by character.

In short

In short

  • You need Python 3.12 or newer and an editor: VS Code with the Python extension, or PyCharm.
  • python --version (python3 --version on macOS and Linux) shows whether Python is installed.
  • python shop.py checks the file, translates it and runs it.
  • If the terminal cannot find the command, open a new terminal.

Next comes the lesson on how to solve a task before a single line of code is written.

Made by Ivo Gergov as part of Evo Tech's campaign for accessible programming education ·