Learn Python - Free Tutorials & AI Guides

Free Python Tutorials, AI Guides & Coding Projects

Python Data Science
Zarr Python 3 Source Tour: How Chunked Array Storage Really Works

Zarr Python 3 Source Tour: How Chunked Array Storage Really Works

Your multi-terabyte simulation output lives in an object store, and every plot starts with the same four-minute wait: a monolithic science file must be partially fetched, parsed, and decoded before a single map can render. The classic fix — slicing...

Python Data Science
xarray Source Tour: Dataset, DataArray and the Lazy Backends Behind Labeled N-D Arrays

xarray Source Tour: Dataset, DataArray and the Lazy Backends Behind Labeled N...

If you have ever wrestled with a 40-year climate reanalysis dataset stored as hundreds of NetCDF files, you know the exact pain: arrays where axis 0 is time, axis 1 is latitude, axis 2 is longitude — and every consumer...

Python Data Science
PyMC Source Tour: Model Graphs, NUTS Internals and the pm.sample() Engine

PyMC Source Tour: Model Graphs, NUTS Internals and the pm.sample() Engine

Every Bayesian workflow eventually hits the same wall: pm.sample() runs for a while, prints a progress bar, and hands back an object full of numbers. The moment divergences appear, or a chain stalls at max tree depth, or a model...

Python Data Science
How joblib Works: Parallel Dispatch, Memmapped Arrays and the Memory Cache

How joblib Works: Parallel Dispatch, Memmapped Arrays and the Memory Cache

You kick off a grid search, walk away for coffee, come back, and the CPU monitor says one core is busy while thirty sit idle. The culprit is rarely your model code; it is the glue around it. joblib is...

Python Data Science
h5py Source Tour: How Cython Binds Python to the HDF5 Binary Format

h5py Source Tour: How Cython Binds Python to the HDF5 Binary Format

Every scientist who has outgrown np.save eventually meets the same wall. NumPy arrays live in memory and die with the process; the moment your data is tens of gigabytes, or several processes need to write it at once, or a...

Python Data Science
Astropy Architecture: A Source Tour of Units, Coordinates, FITS and Time

Astropy Architecture: A Source Tour of Units, Coordinates, FITS and Time

In 1999 NASA lost the Mars Climate Orbiter because one team fed pound-force-seconds into software that expected newton-seconds. Every developer who writes scientific code carries that story in the back of their head, because unit bugs are silent: the numbers...

Python Networking
websockets Source Tour: Sans-I/O Protocol, Frames, and the RFC 6455 Handshake in Python

websockets Source Tour: Sans-I/O Protocol, Frames, and the RFC 6455 Handshake...

Every Python developer who has shipped a realtime feature has met the same three bugs. First, the connection that dies silently behind a load balancer because nobody configured keepalive pings, and the client sits waiting forever on a dead socket....

Python Networking
Uvicorn Source Tour: Inside the ASGI Server That Runs FastAPI

Uvicorn Source Tour: Inside the ASGI Server That Runs FastAPI

Every FastAPI project ends its tutorial with the same incantation: uvicorn main:app --reload. You type it a thousand times without thinking, and then production bites you — a graceful shutdown hangs until the orchestrator force-kills the pod, a worker dies...

Python Networking
urllib3 Architecture Explained: Connection Pools, Retry Backoff and TLS from the Source

urllib3 Architecture Explained: Connection Pools, Retry Backoff and TLS from ...

Every Python developer ships urllib3 whether they know it or not. It is the engine underneath pip, the layer that requests wraps, and a direct dependency of botocore, google-auth, and a long list of SDKs. So when an endpoint starts...

Python Networking
Starlette Source Tour: The ASGI Routing Engine Behind FastAPI

Starlette Source Tour: The ASGI Routing Engine Behind FastAPI

Every FastAPI developer has met Starlette without being introduced. The HTTPException you raise, the Request object you annotate, the BackgroundTasks you inject, the 405 that appears when you POST to a GET-only route — all of that surfaces from Starlette,...

Python Networking
requests Source Tour: Session, HTTPAdapter and the urllib3 Wall Behind Python's Favorite HTTP Client

requests Source Tour: Session, HTTPAdapter and the urllib3 Wall Behind Python...

Every Python developer has typed requests.get(url) a thousand times, and almost nobody has opened the package. That is the whole trick of the library: a four-word facade over a surprisingly disciplined engine. When the facade leaks — a ConnectionError that...

Python Networking
httpx Source Tour: How Client, Transports, and Auth Flows Fit Together

httpx Source Tour: How Client, Transports, and Auth Flows Fit Together

Every Python developer has felt this particular pain: your service calls another service, one day it stalls, and the traceback says httpx.ReadTimeout — but you never configured a read timeout anywhere. Or a connection pool silently holds twenty sockets to...

Python Networking
HTTPie Source Tour: How the Python CLI Builds Requests From Arguments

HTTPie Source Tour: How the Python CLI Builds Requests From Arguments

Every developer knows the pain: you want to test one API endpoint, and suddenly you are five Stack Overflow tabs deep into curl quoting rules, wondering why your JSON body got mangled by the shell. HTTPie exists to end that...

Python Networking
httpcore Source Tour: The Connection Pool and Async Engine Behind httpx

httpcore Source Tour: The Connection Pool and Async Engine Behind httpx

Every developer who scales a Python HTTP client eventually hits the same wall. Your service talks to three upstream APIs, traffic doubles, and suddenly requests stall with a pool timeout or the upstream starts dropping you mid-flight with connection resets....

Python Networking
asgiref Source Tour: The sync_to_async / async_to_sync Bridge Powering Django's Async Stack

asgiref Source Tour: The sync_to_async / async_to_sync Bridge Powering Django...

Every Python developer who has mixed sync and async code has met the same two errors at 5pm on a Friday. The first is RuntimeError: You cannot use AsyncToSync in the same thread as an async event loop - just...

Python Networking
aiohttp Source Tour: ClientSession, Connection Pooling, and the Web Server Layer

aiohttp Source Tour: ClientSession, Connection Pooling, and the Web Server Layer

Every Python service that talks HTTP eventually hits the same wall. You want a client that does not leak sockets under load, a server that survives thousands of idle connections, and none of it to block the event loop. Requests...

Python Dev Tools
How virtualenv Works: A Source Tour of the Venv Builder Behind Every Python Project

How virtualenv Works: A Source Tour of the Venv Builder Behind Every Python P...

Every CI job running tox, every pre-commit hook, every scratch install eventually reaches the same few thousand lines of Python that pypa/virtualenv keeps polishing. When it misbehaves, the symptoms are annoying: a fresh environment with no pip inside it, an...

Python Dev Tools
How tox Works: A tox 4 Source Tour from tox.ini Parsing to Virtualenv Runs

How tox Works: A tox 4 Source Tour from tox.ini Parsing to Virtualenv Runs

Every Python team eventually hits the same wall: the test suite passes on one interpreter and explodes on another, or the package installs fine locally and fails in CI because a dependency drifted. The usual prescription is tox — the...

Python Dev Tools
Ruff Source Tour: Inside the Rust Engine Driving 900+ Python Lint Rules

Ruff Source Tour: Inside the Rust Engine Driving 900+ Python Lint Rules

Every Python team eventually pays the lint tax. Flake8 plus isort plus a formatter means three tools, three config formats, and a CI job that crawls through a large monorepo one interpreter process at a time. On a million-line repository,...

Python Dev Tools
pytest Source Tour: How Hooks, Fixtures, and Assertion Rewriting Actually Work

pytest Source Tour: How Hooks, Fixtures, and Assertion Rewriting Actually Work

If you have ever watched ten thousand green dots scroll past a CI log and then had one red F ruin your afternoon, you have pytest to thank for both experiences. The library is so good at hiding its work...

Python Dev Tools
How pre-commit Works: A Source Tour of the Hook Store, the Stash, and the Run Loop

How pre-commit Works: A Source Tour of the Hook Store, the Stash, and the Run...

Every Python developer eventually meets the same two villains. First: you clone a repo, run git commit, and the terminal freezes for four minutes while it prints “Installing environment for https://github.com/psf/black” — with no idea where those gigabytes went or...

Python Dev Tools
nox Source Tour: From @nox.session to a Finished Session Run

nox Source Tour: From @nox.session to a Finished Session Run

Every Python team eventually hits the same wall: the test matrix grows, conda users and pip users must coexist, docs and lint jobs join the party, and “just run pytest” quietly becomes a shell script nobody dares touch. nox is...

Python Dev Tools
Hypothesis Source Tour: Inside the Property-Based Testing Engine That Shrinks Your Bugs

Hypothesis Source Tour: Inside the Property-Based Testing Engine That Shrinks...

Every developer knows this failure mode. Your test suite is green, coverage looks healthy, and then production falls over on an input nobody imagined: an empty string, a four-byte unicode sequence, a leap-year boundary, a list containing exactly two elements....

Python Dev Tools
coverage.py Internals: How Python Code Coverage Really Measures Your Tests

coverage.py Internals: How Python Code Coverage Really Measures Your Tests

You raise the coverage gate to 85%, CI turns green, and two weeks later production fails in the exact branch nobody ever exercised. That gap between “the number looks good” and “the code actually ran” is where most teams develop...

Watch PyShine on YouTube