A structured environment for learning Python topics, each with isolated virtual environments using uv and version control with git.
Install uv (Python package manager):
# Windows (PowerShell)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Or via pip
pip install uvInstall git (if not already installed):
- Download from git-scm.com
- Or via package manager:
winget install Git.Git
- Navigate to any topic directory (e.g.,
topics/fizzbuzz) - Run
uv syncto create virtual environment and install dependencies - Run
uv run python main.pyto execute the code - Run
uv run pytestto run tests (if available)
Each topic has its own isolated virtual environment in .venv/:
topics/
├── fizzbuzz/
│ ├── .venv/ # Isolated Python environment for fizzbuzz
│ ├── pyproject.toml
│ └── main.py
├── algorithms/
│ ├── .venv/ # Separate environment for algorithms
│ ├── pyproject.toml
│ └── main.py
Automatic (Recommended):
cd topics/your-topic/
uv run python script.py # Runs in topic's .venv automatically
uv run pytest # Runs tests in topic's .venvManual Activation:
cd topics/your-topic/
source .venv/bin/activate # Linux/Mac
# OR
.venv\Scripts\Activate.ps1 # Windows PowerShell
python script.py # Now using topic's Python/packages
deactivate # DeactivateEnvironment Status:
uv sync # Create/update .venv based on pyproject.toml
uv pip list # Show installed packages in current topic
uv tree # Show dependency treetopics/
├── fizzbuzz/ # Example: FizzBuzz problem
│ ├── pyproject.toml # Project config & dependencies
│ ├── main.py # Main implementation
│ └── README.md # Topic-specific instructions
└── [new-topic]/ # Add more topics here
cd topics/
uv init --app new-topic --vcs none
cd new-topic/
uv add --dev pytest # Add testing support- Create a new directory under
topics/ - Copy
pyproject.tomltemplate from existing topic - Update the project name in
pyproject.toml - Add your Python files and README
git add .
git commit -m "Add new-topic implementation"- 📖
README.md- This file (main guide) - 🚀
QUICKSTART.md- Quick setup instructions - 📋
GIT_GUIDE.md- Complete git workflow guide - 🔧
UV_INIT_GUIDE.md- Why we useuv init --vcs none - 🐍
VENV_GUIDE.md- Virtual environment management explained
uv sync- Create/update virtual environmentuv add <package>- Add dependency to current topicuv remove <package>- Remove dependency from current topicuv run <command>- Run command in virtual environmentuv pip list- Show installed packages in current topicuv tree- Show dependency tree for current topic
git add .- Stage all changesgit commit -m "message"- Commit changesgit status- Check repository statusgit log --oneline- View commit historygit branch <name>- Create new branchgit checkout <branch>- Switch branch