Writing

Free scripts, and the parts of them that are easy to get wrong. Every claim on these pages is checked by running the code.

2026-09-14 Two ways urllib.robotparser gets robots.txt wrong It fetches robots.txt as Python-urllib, so a CDN answers 403 and the parser reads that as a total ban. And it takes the first matching rule instead of the most specific one, so the same file gives opposite answers depending on line order. Both measured, both fixed. 2026-09-14 Read an .xlsx file in Python with no dependencies An .xlsx is a zip of XML, and zipfile and xml.etree are both standard library. Around 120 lines, no pip install — including the three things that make it hard: shared strings, dates stored as numbers, and Excel's 1900 leap year bug. 2026-09-14 The CSV number that parses silently into the wrong value float("1.234") returns 1.234 with no error. In a European export that value is 1234, and your total is out by a factor of a thousand. Why locale does not save you, and how to decide per column instead. 2026-09-08 Zapier alternative: when a 20-line Python script replaces a monthly subscription For a single fixed integration between two services, a small Python script often replaces a Zapier/Make subscription outright. Here's how to tell which situation you're in, plus a worked example. 2026-09-08 How to scrape a list of items from a webpage with Python (free script) A free, copy-pasteable Python script (standard library only) to extract repeated items — product cards, listings, search results — from an HTML page into CSV, plus where a fixed-price script stops covering it. 2026-09-08 How to receive a webhook and forward it to another URL with Python (free script) A free, copy-pasteable Python script (standard library only) that receives an incoming webhook and forwards it to another service or appends it to a CSV log, plus where a fixed-price bridge stops covering it. 2026-09-08 How to deduplicate rows in a CSV file with Python (free script) A free, copy-pasteable Python script (standard library only) to remove duplicate rows from a CSV by any column, plus what to do when the file is too messy for a five-line script.