Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: CI

# dev is the working branch: every push to it is checked.
# A pull request into main is the gate before publishing.
on:
pull_request:
push:
branches: [dev]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -30,7 +34,10 @@ jobs:
env:
PYTHON: python
MPLBACKEND: Agg
run: python scripts/check-examples.py
run: python scripts/examples.py --twice

- name: Check lessons against the template
run: python scripts/lint.py

- run: npm ci

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy to GitHub Pages

# main only holds the repo files (LICENSE, .gitignore, workflows); the site lives on dev.
# Run manually from Actions -> Deploy to GitHub Pages -> Run workflow, and pick the dev branch.
# Publishing is manual: Actions -> Deploy to GitHub Pages -> Run workflow, then pick the
# branch to publish (main after a merge, or dev to preview work in progress).
on:
workflow_dispatch:

Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
env:
PYTHON: python
MPLBACKEND: Agg
run: python scripts/check-examples.py
run: python scripts/examples.py

- run: npm ci

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ permissions:
id-token: write

concurrency:
group: release-pages
group: pages
cancel-in-progress: false

jobs:
Expand All @@ -37,7 +37,7 @@ jobs:
env:
VERSION: ${{ inputs.version }}
run: |
python - <<'PY'
python3 - <<'PY'
import os, re, sys
version = os.environ["VERSION"]
pattern = r"\d+\.\d+\.\d+(?:-(?:alpha|beta|rc)\.\d+)?"
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
env:
PYTHON: python
MPLBACKEND: Agg
run: python scripts/check-examples.py
run: python scripts/examples.py

- run: npm ci

Expand Down
236 changes: 13 additions & 223 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,229 +1,19 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[codz]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
# Node and VitePress
node_modules/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py.cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
# Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
# poetry.lock
# poetry.toml

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
# pdm.lock
# pdm.toml
.pdm-python
.pdm-build/

# pixi
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
# pixi.lock
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
# in the .venv directory. It is recommended not to include this directory in version control.
.pixi

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# Redis
*.rdb
*.aof
*.pid

# RabbitMQ
mnesia/
rabbitmq/
rabbitmq-data/

# ActiveMQ
activemq-data/
docs/.vitepress/cache/

# SageMath parsed files
*.sage.py
# Generated into the site (see scripts/copy-runtime.mjs and scripts/build-lab.sh)
docs/public/pyodide/
docs/public/lab/
build/
.jupyterlite.doit.db

# Environments
.env
.envrc
.venv
env/
# Python
__pycache__/
*.py[cod]
.venv/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
# .idea/

# Abstra
# Abstra is an AI-powered process automation framework.
# Ignore directories containing user credentials, local state, and settings.
# Learn more at https://abstra.io/docs
.abstra/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the entire vscode folder
# .vscode/
# Temporary file for partial code execution
tempCodeRunnerFile.py

# Ruff stuff:
.ruff_cache/

# PyPI configuration file
.pypirc

# Marimo
marimo/_static/
marimo/_lsp/
__marimo__/

# Streamlit
.streamlit/secrets.toml

# python.uz site
node_modules/
docs/.vitepress/cache/
.sites-runtime/
dist/
docs/public/pyodide/
build/
docs/public/lab/
# OS
.DS_Store
.jupyterlite.doit.db
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Python Tutorials

A free Python course in **English** and **Uzbek**, from your first `print()` to decorators and async. Examples run in the browser, exercises are checked on the page, and nothing needs to be installed.

**Live site:** [yakhyo.github.io/python-tutorials](https://yakhyo.github.io/python-tutorials/) · [Uzbek version](https://yakhyo.github.io/python-tutorials/uz/)

> Pythonni noldan örganmoqçimisiz? Kurs toʻliq özbek tilida ham bor: [özbekça versiya](https://yakhyo.github.io/python-tutorials/uz/).

## What's inside

82 lessons in 14 modules, written for Python 3.14. Every lesson has runnable examples, common mistakes with real error output, and five exercises with solutions. Every module ends with a quiz.

| Part | Modules |
| --- | --- |
| **Foundations** | [Getting Started](docs/lessons/01-getting-started) · [Values and Variables](docs/lessons/02-values-and-variables) · [Decisions](docs/lessons/03-making-decisions) · [Loops](docs/lessons/04-loops) · [Collections](docs/lessons/05-collections) · [Functions](docs/lessons/06-functions) |
| **Real Programs** | [Standard Library](docs/lessons/07-modules-and-the-standard-library) · [Errors and Files](docs/lessons/08-errors-and-files) · [Classes](docs/lessons/09-classes-and-objects) · [Object-Oriented Design](docs/lessons/10-object-oriented-design) · [Testing](docs/lessons/11-testing-and-debugging) · [Generators and Regex](docs/lessons/12-going-further) · [Data with pandas](docs/lessons/13-working-with-data) *(optional)* |
| **Advanced** *(optional)* | [Decorators, the data model, context managers, async, performance, design patterns and concurrency](docs/lessons/14-advanced-python) |

Seven guided projects along the way: a number guessing game, quiz game, expense tracker, library system, text analyzer, sales report and log pipeline.

The course is complete in both languages. Corrections from a full technical review are in progress.

## Run locally

Requires Node.js 22+ (and Python 3.10+ for the Python Lab).

```sh
npm ci
npm run dev # http://127.0.0.1:5173
npm run build # build the static site into dist/
```

Set `SKIP_LAB=1` to skip building the JupyterLite lab.

## Check changes

```sh
python3 scripts/examples.py --twice # run every code example with Python 3.14
python3 scripts/lint.py # check lessons against the template
```

## Contributing lessons

Add the lesson to `docs/.vitepress/course.json`, then run `python3 scripts/organize-lessons.py` to place the file. Use `docs/lessons/05-collections/04-dictionaries.md` as the reference lesson, and mirror every change in the Uzbek lesson under `docs/uz/darslar/`.

## Deployment

Work happens on `dev`. CI runs on pull requests into `dev`. Deploys and releases to GitHub Pages run manually from the Actions tab.

## License

[MIT](LICENSE) © 2026 Yakhyokhuja Valikhujaev
Loading
Loading