Category: Doings

  • Five numbers and a friendly snake

    Five numbers and a friendly snake

    For many years I’ve described myself as ‘geek-adjacent’. I know lots of people who can do amazing things with code, which means I’ve never had to learn the finer details myself.

    Don’t get me wrong, I know a lot more than most people about HTML, CSS, PHP, systems architecture and whatnot. But then most people don’t know anything about any of that, so it’s not a high bar.

    Anyway, I’ve decided it’s probably about time to partially rectify the situation.

    I’m not planning on becoming a full-stack developer anytime soon, but I have started learning Python.

    Snake charming for fun and profit

    I picked Python because I can use it to set up repeatable processes to help me in my work. That should mean I spend less time worrying about my unreliable memory (yay ADHD).

    The eventual goal is to use Python for practical information processing: inspecting content, finding patterns, working with structured data, improving workflows, and automating things that are actually worth automating.

    Obviously the sensible thing to do would be to get a recommendation for a good course. But sensible isn’t my style, so I’m getting ChatGPT to write me a custom course instead.

    It’s got a proposed syllabus, a progress record, and a custom reference document to contain all the things I have used and understood. Progress will be measured by whether I can explain what the code is doing and demonstrate that I can construct, test, and fix it – not simply by whether I’ve completed a lesson.

    My bots can be mean

    I’ve done my best to train my bots to cut out the flattery and be blunt with me when I’m going off track (Claude regularly tells me to stop pissing around with side projects and get back to what I’m supposed to be doing – which may well be why I’m not using Claude for this project), so hopefully it’s not going to treat me like a 19th-Century dilettante Russian count and give me a passing grade by default.

    The current plan for the course is to move through six phases:

    1. processing fundamentals
    2. structured information, including dictionaries, JSON, and CSV
    3. real files and sources
    4. reliable workflows
    5. content transformation
    6. producing credible evidence of what I can do

    Each learning cycle begins with a problem. To start with, ChatGPT will give me an input, a set of rules, and an intended result. I’ll then attempt to translate them into Python, and ask for help when I get stuck. I’ll also say things like “hey Chat, remind me what the difference is between a function and a method” more times than a human teacher would appreciate.

    Starting small

    I’ve just finished Lesson One. ChatGPT gave me a small data set representing the word counts of five webpages:

    word_counts = [420, 180, 760, 95, 310]

    Then it set me the task of counting the number of pages, adding their word counts together, and working out how many pages had more than 300 words on them.

    So now I know how to use .append(), len(), sum(), and write f-strings – and can make Python count five numbers in several different ways.

    This is a very small achievement, but yesterday I couldn’t do it, and today I can.

    Yay me.

    More to the point, when faced with a blank file I can now write that tiny basic bit of Python from scratch, and can already think of different things I could do with it. Because Python is a little bit like Lego – you have small pieces which do small things (like store a value or add something to a list), and you can connect them together to build bigger, more complicated things – things which didn’t exist before.

    That sounds useful.

    Next lesson: dictionaries and page records.

  • Merlin has turned birds into Pokémon

    Merlin is a bird app. It listens to birdsong and tells you what it thinks it can hear. It’s very good.

    Plenty of people have already told you that, so I won’t go on about it.

    If anything, my other half would like me to stop coming in and saying things like “there are sparrows in the hedge at the end of the street” as if sparrows in a hedge are a surprising occurrence.

    But in case you haven’t come across the app before, it’s dead simple. App hears a bird, app names the bird, you add the bird to the ‘Life List’ and carry on with your day.

    Or rather the app gives you its best guess at which bird it is. Some people may just hit ‘this is my bird’ for every new bird that the app suggests, but not me. I’ve added my own condition before I claim a new bird.

    I don’t add a bird just because Merlin heard it. If it says there’s a treecreeper around and I can’t work out which sound that is, it doesn’t count. I have to be able to pick out the birdsong at the same time as the app, or I have to be able to see the bird myself. Until that happens, it doesn’t go on the app Life List, it goes on my own mental ‘maybe’ list instead.

    The treecreeper has been on that list for about three weeks.

    So now there’s a game – Merlin hears something and I try to find it. Occasionally spending ages standing under a tree listening like an idiot, waiting for it to do it again.

    Some are easy. A wood pigeon sounds like a wood pigeon. A robin sounds like a robin. A wren sounds like a noisy little bugger that has no right to be quite so loud.

    It’s like Pokémon Go – the app telling me that one is nearby becomes my cue to go and find it (I don’t play Pokémon Go any more because it was taking up way too much of my time, at least with ‘Merlin Go’ I’m appreciating the natural world around me).

    The best discovery so far is the long-tailed tit, which I’d never knowingly seen before. Picture a ball of fluff with a lolly stick attached. Less a bird, more the world’s smallest feather duster. It took a while to actually find them because they are tiny weeny little things – but if the app tells me one is close, I will happily stare into a tree to try and spot it.

    Long-tailed tit by Alexis Lours, CC BY 4.0, via Wikimedia Commons

    The treecreeper is the one I can’t crack. Merlin keeps insisting they’re there in the tall pines in the park. Unfortunately a small brown bird that creeps up tree trunks looks a lot like a tree trunk.

    So I stand and stare at bark.


    Update 2/6/26: I saw the treecreepers while I was at lunch with my dad!