Skip to content

Latest commit

 

History

History
204 lines (129 loc) · 6.45 KB

File metadata and controls

204 lines (129 loc) · 6.45 KB

Prerequisites

What you need before starting this course.

Required Software

Python 3.14 or later

Check if Python is already installed:

python --version

On some Linux systems, you may need to type python3 --version instead.

If not installed or the version is below 3.14:

  • Windows: Download from python.org. During installation, tick "Add Python to PATH".
  • macOS: Download from python.org or install via Homebrew: brew install python
  • Linux: Most distributions include Python. If not: sudo apt install python3 (Debian/Ubuntu) or sudo dnf install python3 (Fedora).

A Text Editor

Any text editor works, but VS Code is recommended for beginners:

  • Download VS Code
  • Install the Python extension by Microsoft (provides syntax highlighting, linting, and debugging)

Other good options: PyCharm Community Edition, Sublime Text, or any editor you are comfortable with.

A Terminal

You will run Python from the command line throughout this course.

  • Windows: Use Command Prompt, PowerShell, or the terminal built into VS Code.
  • macOS: Use the built-in Terminal app or the terminal in VS Code.
  • Linux: Use your distribution's terminal emulator.

Git (from Part 3)

Git is not needed for Parts 1-2 but becomes essential from Part 3 onwards.

  • Windows: Download from git-scm.com
  • macOS: Install via Homebrew (brew install git) or Xcode Command Line Tools (xcode-select --install)
  • Linux: sudo apt install git (Debian/Ubuntu) or sudo dnf install git (Fedora)

No Prior Experience Required

This course assumes no prior programming experience. If you have never written a line of code before, start with Module 01 and work through the parts in order.

If you already have some Python experience, read the module list in the README and jump in where the content is new to you.

Verifying Your Setup

Create a file called hello.py with this content:

print("Ready to learn Python!")

Run it from your terminal:

python hello.py

If you see Ready to learn Python! printed, your setup is working and you are ready to start Part 1.

If you are using VS Code, save the file before you run it again. If your terminal output does not reflect your latest change, the file often was not saved yet.

Getting a Local Copy of the Course

If you are unfamiliar with GitHub, start with the ZIP download method. You can learn Git later in Part 3.

Option 1: Download ZIP from GitHub

  1. Open the repository page in your web browser.
  2. Click the green Code button.
  3. Choose Download ZIP.
  4. Save the ZIP file to your computer.
  5. Extract it somewhere easy to find, such as:
    • Windows: Documents\programming-foundations
    • macOS/Linux: ~/Documents/programming-foundations
  6. Open the extracted folder in VS Code.

This is the easiest way to begin if you just want to study the course locally.

Option 2: Clone with Git

If Git is installed and you want the normal developer workflow, run:

git clone https://github.com/daniel-craft/programming-foundations.git
cd programming-foundations

Cloning is better if you plan to pull later updates or contribute back to the repository.

Your First Five Minutes

Once the course folder is on your machine:

  1. Open the folder in VS Code.
  2. Open the root README.
  3. Decide where to start:
    • complete beginner -> Part 1
    • some Python already -> see the skip-ahead guidance in the README
  4. Create and run hello.py as shown above.
  5. Read Study Guide before starting your first module.

Optional: Create a Virtual Environment

You do not need this for the very first module, but it becomes important once you start running projects, installing packages, or using check.py.

Create a virtual environment inside the course folder:

python -m venv .venv

Activate it:

# Windows
.venv\Scripts\activate

# macOS/Linux
source .venv/bin/activate

When it is active, your terminal prompt usually shows (.venv) at the start.

Why Virtual Environments Matter

A virtual environment gives one project its own isolated Python installation and package set.

This matters because:

  • different projects often need different package versions
  • installing everything into your base Python eventually causes conflicts
  • project environments become easier to recreate and debug

As a rule:

  • for the earliest standard-library-only modules, you can start without one
  • once you begin installing packages, a virtual environment should become your default habit

Packages, pip, and site-packages

When you install a package such as requests, it gets placed into the current Python environment, usually inside that environment's site-packages directory.

That is why it matters which Python environment is active when you install something.

The standard Python workflow is:

python -m venv .venv
python -m pip install requests

That teaches the core model clearly and is still widely used. This is the model you should understand first, even if you later use a smoother tool on top of it.

Then Move to the Recommended Workflow: uv

Once you understand the standard model, this course recommends uv as the normal workflow for active projects. It can create environments, add dependencies, and run project commands with a cleaner workflow.

Install uv using Astral's official installation guide:

Inside one of your own project directories, typical examples are:

uv venv
uv add requests
uv run python hello.py

Use this mental sequence throughout the course:

  1. learn the standard Python model once
  2. understand where packages go and why environments matter
  3. use uv as the practical default from there onward

Learn the Model, Not Just the Command

Whether you use pip or uv, the underlying ideas are the same:

  1. a project should have isolated dependencies
  2. third-party packages come from package indexes such as PyPI
  3. installed packages live inside the active environment
  4. project dependencies should be recorded, not memorised

For a fuller explanation, see Python Environments and Packages.