Around 2018, I sat across from a coworker — let's call him D — who had a habit of stepping away for lunch with his screen wide open. I told him about it. Twice. He laughed both times and forgot the next day.
So I taught him with twelve lines of Python.
The setup
macOS ships with a command-line utility called say . You pipe text to it, and your laptop talks. Or, more accurately, your laptop talks to everyone in the office .
The plan was simple:
Sneak onto D's laptop while he was at lunch.
Run a tiny HTTP server in the background.
From my own desk, send GET requests with words I wanted his laptop to shout across the room.
Wait.
The whole thing
from subprocess import check_output from aiohttp import web
async def handle ( request ): name = request . match_info . get ( " name " , "" ) text = name check_output ( f " /usr/bin/say ' { text } '" , shell = True ) return web . Response ( text = text )
app = web . Application () app . add_routes ([ web . get ( " /{name} " , handle )])
web .…