DEV SETUP
Python Learning Curriculum - Development Environment
Quick Start
0. Install Tooling (one-time)
cd /home/reaz/py/python_learning
make install # creates venv/, bootstraps pip, installs deps
Note:
make installwill downloadget-pip.pyviacurlthe first time it needs to bootstrappipinto the virtual environment.
1. Activate the Virtual Environment
source venv/bin/activate
2. Run Examples
# Run any examples file (manual)
python 01_python_basics/examples.py
# Or via Makefile (overrides with EXAMPLE)
make run-example EXAMPLE=14_concurrency/examples.py
3. Run Exercises (with tests)
# Run specific exercise tests
python -c "from 23_security.exercises import run_all_tests; run_all_tests()"
# Or use pytest / Makefile helpers
pytest 17_testing/exercises.py -v
make topic-test MODULE=23_security
4. Interactive Learning with IPython
make ipython
# Then import and experiment:
# >>> from 05_functions.examples import *
5. Common Developer Commands
| Command | Description |
|---|---|
make help | List all helper targets |
make install | Create venv and install project + dev deps |
make test | Run pytest across every topic |
make topic-test MODULE=20_data_science_ml | Test a single topic's exercises |
make run-example EXAMPLE=07_file_handling/examples.py | Execute any examples file |
make lint | Run Ruff lint checks |
make format | Format code with Black + isort |
make typecheck | Run mypy type checks |
make ipython | Launch IPython inside the venv |
make clean | Remove the venv and caches |
Project Structure
python_learning/
āāā venv/ # Virtual environment
āāā pyproject.toml # Project configuration
āāā 01_python_basics/ # Topic 1
ā āāā README.md # Theory & explanations
ā āāā examples.py # Runnable demonstrations
ā āāā exercises.py # Practice problems with tests
āāā 02_strings/
āāā ...
āāā 23_security/
Running Tests
# Run all tests in a module
pytest 23_security/exercises.py -v
# Run with coverage
pytest 17_testing/exercises.py --cov=. --cov-report=term
# Run specific test function
pytest 23_security/exercises.py::test_password_manager -v
Installed Packages
| Package | Purpose |
|---|---|
| pytest | Testing framework |
| ipython | Enhanced interactive Python |
| numpy | Numerical computing |
| pandas | Data analysis |
| matplotlib | Data visualization |
| requests | HTTP library |
| flask | Web framework |
| fastapi | Modern async web framework |
| sqlalchemy | Database ORM |
| beautifulsoup4 | Web scraping |
| bcrypt | Password hashing |
| cryptography | Encryption |
Tips
- Start with basics: Begin at
01_python_basicsand progress sequentially - Read README first: Each topic has a detailed README.md explaining concepts
- Run examples: Execute examples.py to see concepts in action
- Practice exercises: Complete exercises.py and run tests to verify
- Use IPython: For interactive experimentation
Deactivate Environment
deactivate
# Remove everything created by make install
make clean