Scripting a TV and Chromecast
This archived note is about scripting two ordinary devices: a Samsung TV and Google Chromecast. Both are controlled from Python as part of a smartly built dumb house.
This archived note is about scripting two ordinary devices: a Samsung TV and Google Chromecast. Both are controlled from Python as part of a smartly built dumb house.
Collecting measured values is often the easier half of the task. Processing, storing, and displaying them reasonably is harder. This archived note shows how Google Sheets, Google Forms, and a little Python can work as a simple time-series database.
There are many tutorials on getting DS18B20-based 1-wire thermometers running, but practical experience with multiple sensors and subsequent data processing can still be useful. This archived article describes sensor choice, wiring, Raspberry Pi configuration, and simple Python reading.
This archived article opens a mini-series on building a smart home without expensive smart wiring, central control systems, or cloud-connected devices. I describe why I preferred a decentralised 'dumb house with smart functions' and outline the subsystems used in my own installation.
This short article extends the previous post on parsing Wikipedia XML dumps. It shows a small piece of code for iterative XML loading with ElementTree, which is now part of the Python standard library.
This archived note is useful for anyone working in machine learning who needs to process large amounts of text from Wikipedia. It shows several pieces of Python code that help with extracting clean text from MediaWiki pages.
Python handles runtime errors with exceptions. This debugging post shows a Python 2.x trap where missing parentheses in an except clause can overwrite an exception name and make later exception handling behave incorrectly.
In several projects we used MongoDB for its flexible data representation. This archived technical note shows how to serve files stored in MongoDB GridFS through an HTTP server written in Python, including a Tornado StaticFileHandler-based approach.
In June and July 2014, I used the methods I had worked with in my dissertation in a Kaggle competition on multi-label classification of Greek media articles. The competition ran from 2 June to 15 July 2014 and ended with my model in third place out of 121 teams.
Regular expressions are popular among many programmers. This debugging article looks at what is wrong with the expression [+-0123456789] and why a minus sign inside a character class can change the whole meaning.
This debugging note only touches Python indirectly, but a Python Tornado server plays the main role. It describes a problem with proxying WebSockets through Apache and why HTTP subpaths had to be proxied explicitly before the WebSocket path.
Where did the bug probably happen? This typical debugging question opens a short series about Python bugs that look obvious only after they are found. The first example shows how a missing comma in a multiline tuple or list literal can lead to surprising behaviour.