Building Programs
Practical Python
Build real programs with proper structure
Welcome! We're going to move beyond simple scripts and learn how to build well-structured Python programs you can be proud of.
From scripts to programs
You've likely written some Python scripts already. Maybe they were short, single files that ran from top to bottom.
python
# my_script.py
name = input("What's your name? ")
print(f"Hello, {name}!")That's perfectly fine for small tasks. But as projects grow, you'll want to organize your code better. This helps with readability, reusability, and maintainability. That's where building a "program" comes in.
What you'll build
We will create a command-line utility. This program will help manage a simple collection of tasks or to-do items. It will let you add, list, and mark tasks as complete.
- Organize code into multiple files (modules).
- Handle user input from the command line.
- Read and write files, and save structured data as JSON.
- Store and retrieve data persistently.
- Write basic tests for your code.
This project uses common patterns you'll find in many real-world applications. The skills you learn are highly transferable.