Real Python (@realpython) header
Real Python (@realpython) profile picture

Helping Python developers build with AI: apps, agents, models, and AI-assisted coding. Expert-reviewed tutorials and courses, read by 1M+ developers a month.

Joined August 2012
Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)Photo by Real Python (@realpython)
Win three years of Real Python, plus all four of our Python books. That's our Black Friday giveaway. Entering is free, you just need a free Real Python account. Entries close Friday, November 27. realpython.com/blackfriday?u…
1
2
1
9
2,495
Python's creator didn't step down over a scandal. He stepped down over two characters: := The 2018 fight over the walrus operator ended Guido van Rossum's 23 years as BDFL. Bruce Li tells the story, starting with a 1989 Christmas break in Amsterdam. hackernoon.com/guido-van-ros…
1
5
939
Ask an LLM about your company's private docs and you get nothing useful. It never saw them. The Vector Databases and Embeddings With ChromaDB course shows how to store embeddings and hand the model the context it's missing. realpython.com/courses/vecto…
1
5
1,600
Know some Python and want to work with data? Load it → clean it → analyze it → chart what it means. Real Python takes you from your first DataFrame to confident analysis on real datasets. Get your free learning plan 👇 realpython.com/start/data-sc…
2
9
1,367
Want to call an LLM from Python and then hand it tools? This free starter kit has a cheat sheet, working code, a full video course, and a quiz to check yourself. realpython.com/kits/ai-apps-…
2
9
2,811
4. To style points by a condition, use a Boolean NumPy mask. The tutorial splits 40 simulated bus arrivals by whether each one falls under y, a probability curve: in_region = bus_likelihood < y[bus_times] Masked points become green dots, the rest red x markers.
1
459
3. For color, you can pass c a list of RGB tuples, like (0, 1, 0) for green, and get traffic-light colors for low, medium and high sugar. Or pass c the raw sugar numbers, pick a cmap and call plt.colorbar(). Now color is a continuous scale with its own legend.
1
27
2. Plot a café's orange drinks and cereal bars with two plt.scatter() calls, and one drink vanishes. There are six drinks but five dots, because a cereal bar at the same spot covers one. alpha=0.5 on both calls makes the markers see-through, so the hidden drink shows up.
1
2
61
1. One café sales chart puts five variables on two axes: x: price y: sales per day s: profit margin, as marker size c: sugar content, as marker color marker: drink or cereal bar plt.scatter() takes a separate size and color for each point. plt.plot() can't.
1
3
73
plt.plot(x, y, "o") draws the same scatter plot as plt.scatter(x, y), and it's typically several times faster. plt.scatter() earns the extra time when points differ: 1. Five variables, one chart 2. A hidden dot 3. Color from numbers 4. A Boolean mask 🧵
2
8
3,218
Our Black Friday giveaway winner gets everything Real Python publishes over the next three years. That includes Mentor AI on every page and weekly live Office Hours. Free to enter. realpython.com/blackfriday?u…
5
1,513
I guess we need to talk about code inheritance at some point
1
48
You can read the full manifesto here: slopmanifesto.com Want to sign it? Leave a comment on this gist with your name, company, or X handle: gist.github.com/dexhorthy
1
446
Claude Code also flagged that two add commands running at once can interleave CSV rows. Single-user CLI: fix or ship? The tutorial has the fourth bug and both fixes. realpython.com/how-to-use-cl…
427
5. The prompt asking Claude Code for tests never named a framework. CLAUDE.md had one line: "Prefer the standard library." It's meant to steer Claude Code to unittest over pytest. If it tries to install pytest anyway, press Esc and redirect it.
1
413
4. Press Shift+Tab twice from the default mode for plan mode. Claude Code proposes changes but doesn't edit files. For a contacts CLI, its plan listed files, function signatures, edge cases and a six-step verification list, so you could push back before any code existed.
1
45
3. When Claude Code writes unittest tests, it also creates an empty tests/__init__.py. Don't delete it. unittest only looks for tests in folders that are importable packages. Without that file, python -m unittest finds nothing and reports NO TESTS RAN.
1
48