Python Intermediate

This is where your Python starts to look like a pro wrote it. Sixteen tutorials cover modules, packages, iterators, generators, closures, decorators, context managers, regex, the collections module, datetime, and logging. These are the tools that show up in every serious codebase.

Python: Context Managers, with Statement & Custom Managers

A Python context manager is the machinery behind the with statement. This post opens it up so you can see exactly how with works under the hood, what the __enter__ and __exit__ methods do, how to build your own context manager with a class or the @contextmanager decorator, and the patterns that stop resource leaks in real apps. “The cleanup code you never run is the bug you never see coming.” Every developer who has leaked a file handle Last ... Read More

Python: 50 Libraries Every Developer Should Know (The Ecosystem Map)

PyPI (Python Package Index) holds over 500,000 packages, and nobody can learn them all. This post cuts that mountain down to the 50 Python libraries that actually matter, grouped by what you are trying to build, each with its install command, a one-line description, and the moment you would reach for it. “If I have seen further, it is by standing on the shoulders of giants.” Isaac Newton Last Updated: July 2026 | Tested on: Python 3.14.6 | Difficulty: Intermediate ... Read More

Python: Iterators and the Iterator Protocol

Ask Python to loop over a list, a file, or a dictionary, and it plays the same trick every time: it asks the object for a Python iterator, then pulls values one by one until StopIteration says stop. This post unpacks that protocol, __iter__ and __next__ included, and shows you how to build a custom iterator of your own. “Simple is better than complex. Complex is better than complicated.” Tim Peters, The Zen of Python (PEP 20) Last Updated: July ... Read More