If you've heard the phrase, automate the boring things for Python, this episode starts with that idea and takes it to a whole nother level.
We have Glyph back on the podcast to talk about programming your computer with Python.
We dive into a bunch of tools and frameworks and especially spend some time on integrating with existing platform APIs.
For example, macOS's browser kit in Windows, Calm object model, all of this to build desktop apps in Python that make you happier and more productive.
Let's dive in. This is Talk Python To Me, episode 508, recorded May 6th, 2025.
Are
you ready for your host, please?
You're listening to Michael Kennedy on Talk Python To Me.
Live from Portland, Oregon, and this segment was made with Python.
Welcome to Talk Python To Me, a weekly podcast on Python.
This is your host, Michael Kennedy.
Follow me on Mastodon where I'm @mkennedy and follow the podcast using @talkpython, both accounts over at fosstodon.org and keep up with the show and listen to over nine years of episodes at talkpython.fm. If you want to be part of our live episodes, you can find the live streams over on YouTube. Subscribe to our YouTube channel over at talkpython.fm/youtube and get notified about upcoming shows. This episode is sponsored by Posit and Posit Workbench.
Posit Workbench allows data scientists to code in Python within their preferred environment without any additional strain on IT.
It gives data scientists access to all the development environments they love, including Jupyter Notebooks, JupyterLab, Positron, and VS Code, and helps ensure reproducibility and consistency.
If you work on a data science team where consistency matters, check out Posit Workbench.
Visit talkpython.fm/workbench for details.
And it's brought to you by Agency.
Discover agentic AI with agency. Their layer lets agents find, connect, and work together, any stack, anywhere. Start building the internet of agents at talkpython.fm/agency, spelled A-G-N-T-C-Y. Bliff, welcome back to Talk Python To Me. Great to have you here.
It's great to be back.
Yes, indeed. We are going to bring it home for everyone. Personal computing right on their computer. Like we're going to program like it's 1997, but better.
It's weird how you say that, and I totally know what you mean, but also, believe it or not, computers are way better than they were in 1997.
Better than my Pentium? Are you serious?
Not only are they better, there's just a lot more of them in front of you in a much smaller space.
Yeah, I have a ridiculous number of computers in my office. It's almost out of control.
What do you do with the old ones? You turn them into servers. Come on. Home servers.
That's a topic for a different day.
Yeah, it sure is. I'm super excited to talk about programming a computer. We're going to talk a little bit of Mac, a little bit of Linux, a little bit of Windows, and more broadly, other things. Most of it with Python, not 100% necessarily, but almost all of it. And it's going to be a great time. Now, before we dive into it, though, I'm sure there's some folks out there like, Cliff, that's the guy that just is so unique. He gets to go by a single name. How awesome is that? But who is he anyway? Who are you?
Who
am I? That's a good question. I've had a varied and eclectic career, I guess.
Right now, I am an independent software developer. I do some consulting here and there. I do a bunch of open source development. I've got a Patreon for my own independent stuff. I'm sure we'll get into some of it because some of it is directly relevant to today's topic. I'm doing some Mac desktop app development. I've got some secret projects, which I hope that I will eventually actually finish and release.
It's awesome you're here to announce those today.
Unfortunately, I don't think we're going to be making any news just now.
Yeah, so I do, and I do a bunch of open source project development.
So my own Patreon and my own GitHub sponsors is mostly about kind of different stuff that I'm doing.
And this talk that we're going to be discussing today that I did give a couple of years back, and I'm giving a refreshed version of at the upcoming PyCon, I did release a couple of packages when I first gave it, and that's the kind of stuff that I do with my personal backing that folks sign up for.
But I'm also doing, I suppose I should say for any new listeners, I am the founder of the Twisted project, kind of precursor to AsyncIO in the standard library.
And nowadays, now that AsyncIO is kind of standard in the standard library, it's a collection of protocol implementations and testing tools and whatnot for event-driven programming.
And that is a member project of the PSF, which has its own GitHub sponsors.
And I also am going to be doing some contract development to do maintenance on that.
So we can actually make use of some of the funding that we've collected over the years, do some more fundraising.
Just a couple hours ago, I was doing our first party WebSockets integration.
So I do a lot of different things, is what I'm saying.
It's just got a lot going on.
That's awesome.
I love it.
How does one get their project to become a member project of the PSF?
Technically speaking, Twisted is a, the PSF is the Twisted Project's fiscal sponsor.
We got there via the circuitous route of really not wanting to make a nonprofit 501c3 25 years ago.
And in the course of trying to avoid that, we signed up with the Software Freedom Conservancy.
The SFC and Twisted weren't quite aligned because Twisted was like a really liberally licensed project that was mostly focused on infrastructure.
And we were not particularly interested in like the free software movement-y aspects of things.
And the SFC was largely about like GPL license enforcement, creating like a consistent legal environment under which the free software movement can operate.
Make sure people copy left everything, that sort of thing.
Let's try to get everybody to copy left everything, although they do do a little bit of that.
And I'm sure they would certainly prefer it, but more about like enforcing it once you have.
Yeah,
that's what I mean.
They have a
number of projects like Inkscape.
And I believe they, well, they do work with a bunch of different projects to kind of litigate and try to, you know, get people to obey the GPL.
and so since we had a little bit of a you know differing goals and the psf is more interested in like promoting python as infrastructure we moved over our fiscal sponsorship to to the psf so mostly i think you know the way that you do it is you just ask but the psf is taking on a lot right now so you may be you may be in a long queue if you were to try to sign up now
i'm sure it's a hard process and they filter a lot of stuff out that doesn't really fit obey the gpl i feel like that's a good conference shirt or maybe a hat.
You know what I mean?
Once again, a topic for a different day.
I have enough feelings on that to fill a couple hours.
Well, moving right along then.
I first became aware of your talk sitting in the sunshine in San Francisco at PyBay two years ago, I suppose, coming up a year and a half, something like that, when you gave a variation of this talk, programming your computer with Python.
That was a great talk.
That's one of my favorites from the conference.
Then I saw you're giving it again at PyCon.
And so I thought, you know, you're still into this stuff.
Let's talk about some more about it.
What really inspired this talk in the first place, and it's pretty much, it's like as relevant now, I think, as it was back when I first thought to give it, was just like, Python is really popular in a bunch of different contexts.
But particularly at PyBay, right?
Like there's different audiences.
And PyBay and PyCon, I think, have a kind of similar audience in that you get a lot of people doing the typical stuff with Python, which is to say backend development and web development.
A
lot of APIs, a lot of AIs, a lot of Jupyter.
Jupyter
is like starting to edge a little bit closer to what I'm talking about here, but it is still fundamentally kind of backend-y, like you kind of expect the code to run on a big cluster or something, and there's just not a ton of local compute, right?
Like your typical data scientist is doing kind of batch stuff.
It's not, Jupyter has little, and Jupyter is in a way like a microcosm of Python itself, in that there are interactive widgets in Jupyter.
You could be programming stuff kind of quasi locally, right?
Like you could be interacting with your own file system.
You could be building stuff that you can directly manipulate the data, but like you probably aren't.
You probably just, you know, loading up some data frames and, you know, some NumPy arrays or whatever, and then doing a bunch of batch computations on them.
And so we build all these skills that about just generalized software development, like most of the skills that you build while working on Python do generalize. And then we kind of staple those general skills to this very specific, like a couple of very specific use cases when Python is like a super general tool.
And there exist all these libraries and all these tools to help you put Python in all kinds of places to solve all kinds of problems.
And then when we need to do like we solve some other problem, we end up just picking some other tool.
And this is in a way, right?
We're talking about this one talk that I've put together.
I've delivered a few times and we'll be delivering again.
But there's kind of a through line through a lot of my public speaking and a lot of the topics that I've covered that are different aspects of this.
Right. We've got there's this one, which is like programming your own local computer.
But there's also desktop development and there's also mobile development.
And I've talked about front end. I gave a presentation.
I don't even know when maybe PyCon 2009 or something about like using.
But before there was PyScript, there was Pyjamas, right?
PyJS, these like front end frameworks where you could build whole front ends with Python in the browser.
And like, you know, because there's Python's the second best language for everything.
That's really, really powerful.
It's kind of better than being the best language for something.
Because the best language for making a Mac app is Swift, right?
Like you just get the first party thing from Apple and it's a really easy onboarding experience.
But the problem with that is that it's the best language for Mac app development.
So everything else is like a second class citizen in the Swift world.
Or a complete foreigner where it doesn't work at all.
I
do say a second class citizen because there is a Swift backend ecosystem and you can kind of use it for that stuff.
and there is a bunch of open source work, but it's very clearly deprioritized.
Even as Apple itself invests resources into it, it's just clearly never going to be the thing because they have a strategic vision.
They're all about moving miles and miles of capacitive touchscreen glass.
And if you're not in the critical path of doing that, then fundamentally the market is just not going to prioritize that.
Even within the Apple ecosystem, the Mac desktop is deprioritized compared to iOS.
The
Mac is doing very, very well right now, right?
It's not a dire situation, but you can still tell.
There's still hints there about how that kind of financial destiny shapes things.
And in the Python world, people just kind of do stuff.
And we don't have a roadmap or a set of priorities.
There are certainly economic pressures.
AI is certainly distorting the landscape a little bit right now in terms of what gets interest and hype.
But if you're doing something cool with Python, like Blender has Python in it, And you can just use that.
And it's been there for years and years.
It's not going anywhere, right?
Like it's not getting deprioritized.
The people who put Python into Blender and do stuff with that have their reasons for doing it.
And they're going to keep doing it.
There's no email they're going to get from an executive that says, ah, never mind, you know, Python really needs to focus on AI now.
So Blender's an LLM today, right?
Like, no, they have their own stuff that they're working
on.
You probably get it to render the words LLM, but that's not what they mean.
All that said, Python being the second best language for everything means that if you're going to do a desktop thing with Python, you still have access to all of those libraries and all those tools that you could bring with you.
If you're going to do desktop automations in Python instead of like AppleScript, you've got all the libraries that come from the world of Python that allow you to have access to all of this power, all that expertise that you've built up over the course of your career doing back end stuff or data analysis that you can then just do on your own computer.
And so there's a few aspects to this, which are there's like the kind of personal automation stuff.
There's the user interface stuff.
So yeah, so how would you like to approach this?
What would you like to talk about?
Let's start with riffing a bit on why local computing matters or maybe why it shouldn't be as overlooked as it is.
I
talked a lot about the library ecosystem and all these different tools and functionalities, whatever.
But bring it back down to fundamentals.
Your computer is probably really, really fast.
Even if you don't have the best top-of-the-line machine, and a lot of us as developers do have a lot of privilege to have access to extremely powerful hardware, Like a laptop that you can get right now for kind of a middle of the road, affordable laptop price is like hundreds of times more powerful than the most powerful server from a couple of decades ago.
Right. Like there's you have so much power at your fingertips.
And not only that, but there's a latency issue, too.
Right. Like even if your computer weren't that powerful, even a few years ago when computers didn't have as much CPU and as much RAM.
And, you know, there's kind of a slope that goes upwards over time where there's always more of those things.
So like anytime you go backwards a few years, you'll have less of it.
But there's persistently throughout the history of computing, you pretty much always get better latency if you're doing something locally.
And so if you are trying to, you know, get something done and you're, if you have a workflow that you're executing many, many times a day and you want to get it done quickly, your local computer is probably faster than any remote server you have access to just to like get the task kicked off, get all the data resident.
I have an eight core server for all the infrastructure at Talk Python with the eight core, 16 gigs or something like that. It's plenty. I'm pretty sure my M4 Mac mini on a single core operation is faster than it. It's
interesting how you phrase that, right? Like you don't even know, right? You're not even sure how much compute you have locally because you're not, you're not stressing it, right? Like you're not using it up. Not to mention the fact that those Talk Python infrastructure, you know, running the most popular podcast in the Python space. I'm sure that it's all very heavily loaded, right? There's stuff happening to it all the time. Every time you post anything on the Fediverse, it's got to be fetched, you know, a hundred million times or whatever the hug of death is these days.
It's like a DDoS that you do to yourself every time you post something.
You have all of your local compute is also, in addition to being probably way more powerful than you initially would give it credit for, because you think of it as like a desktop or a mobile device as opposed to like a really powerful computer. In addition to being super low latency, it's also probably just idle all the time, right? Like it's not doing anything. And if you're plugged in and you're at a desk, right? Like if you're not literally mobile on battery all the time, that's free real estate, right? Like you can just use it for whatever you need. You got lots of RAM, you got lots of disk, you got lots of CPU overhead. To some extent, this is also kind of my secret motivation for doing this. Over the years in the industry, and you can kind of see this with that push towards iOS and iPads and mobile devices and web front ends. There's always this push for the industry as overall to say, maybe you don't need so much power locally. Maybe we should take that away and put it in the cloud. Wouldn't it be more convenient if it was all in the cloud?
And there's no nefarious individual or group that's doing this, but it's just a constant economic pressure. And my personal feeling is like, no, no, give it to me. You put all the compute locally.
I want to have it. I don't know what you're doing with it. I don't want it multi-tenanted in the cloud where I have like fewer security guarantees and fewer privacy guarantees and if I want things to be fast I have to like move them away to be like less secure I want it to be local so I want people to do things that require it to be local and so I want to encourage them
and I'm with you and there's a lot of interesting technologies these days that make that possible from local LLMs to Docker to a bunch of things this portion of talk Python to Me is brought to you by the folks at Posit Posit has made a huge investment in the Python community lately, known originally for RStudio, they've been building down a suite of tools and services for Team Python. Have you ever thought of all the things that go into a Python data science project? You need your notebook or IDE, sure. Also a server or cloud environment to run it, a version of Python, packages, access to your databases, and internal APIs. That's a lot of setup.
And if you change any of these things, when you return to your projects a month down the road, you might get different results. Wouldn't it be nice to have all of this set up for you in one easy to access place whenever you want to get work done? That's the goal of Posit Workbench.
Posit Workbench allows data scientists to code in Python within their preferred environment without an additional strain on IT. It gives data scientists access to all the development environments they love, including Jupyter Notebooks, JupyterLab, Positron, and VS Code.
and yet it helps ensure reproducibility.
Here's how it works.
You or your IT team set up Posit Workbench on a powerful, dedicated server within your organization or on the same cloud service that is hosting your most important data sources, such as AWS, SageMaker, Azure, GCP, Kubernetes, or pretty much anywhere.
There, you create dedicated, pre-configured environments to run your code and notebooks.
And importantly, you also configure access to proprietary databases and internal APIs.
When it's time to onboard a new data scientist or start a new project, you just fire it up in Workbench and it's fully configured and ready to go, including on the infrastructure side of things.
All of this is securely administered by your organization.
If you work on a data science team where consistency matters, you owe it to you and your org to check out Posit Workbench.
Visit talkpython.fm/workbench today and get a three-month free trial to see if it's a good fit.
That's talkpython.fm/workbench.
The link is in your podcast player's show notes.
thank you deposit for supporting talk python to me i don't know how you feel about it it sounds like we might be on the same page to me it's also a bit of agency just i don't want the only place that my code can run is on a bespoke cloud from one of the hyperscalers i want to be able to at maximum complexity say docker compose up and then run my code at more likely just run my code there's
a scaling issue there too if you try to make sure that you can run we'll get to like uis and interactivity in a bit, but even if you're just running your backend batch code, if you can run your full deployed cloud-based web application on your local computer, and you can have an equivalent environment that you can bring up with Docker Compose or whatever, or I forget what the tiny Kubernetes is, the K some number.
Kube control.
There's also like a, there's K7S, I think.
There's some tool that like, you know, scales everything down for you.
If you can run it on your laptop, then you can run it on an alternate host, right?
Like speaking now, now kind of stepping out of my weird hippie activist, individual activism frame of reference and into my, I'm actually a consultant that does business for, you know, corporations kind of role.
They're actually pretty aligned value wise, because you, if the only place that you can run your cloud application is in a hyperscaler's cloud, then you have no price pressure driving the competitive landscape in a way that benefits you as the application developer. I won't say a brand name, but your cloud provider will ratchet up your costs and then you'll just have to pay more costs.
There's no way that you have any leverage against them to say, well, because you can't credibly say, I'll move somewhere else because moving somewhere else becomes this huge migration cost.
Now, there's limits to that, right?
Like there are applications that you really can't run just fully on a laptop.
But like there's a way larger proportion of our listeners today who can totally just do that than think they can, right?
Like there are most applications can actually just run on a laptop.
I don't know what number you'd put on it.
I would say it's got to at least be 95%.
It's
tough to put like a number on it like that, but it is also the kind of thing where if it's not 95%, there's also like a lot of the ones that really can't because they're architected around like cloud native or, you know, branded technologies that have like these very specific APIs.
It's not clear to me that that's bringing a lot of benefits in a lot of cases, right?
Like, you know, having it, especially because like whenever you're running something locally, you also have, especially if you can like make sure that it's easy to be portable, right?
Like, and you can run it locally on your Mac, locally on your, in WSL, right?
Not just in Docker, but like kind of in the same environment that your dev tools live.
If you can maintain that level of portability, the increase in operational costs that you have when you have to go and do complicated stuff to get the reliability and the elasticity that your cloud provider might give you, you actually get a huge amount in just like, you can run a debugger on it.
You can single step through the code.
The ability
to do that is really overlooked.
And that's not to denigrate debugging and production, using tools like Honeycomb that can give you traces and help you really understand what's happening at scale.
There's a lot of logical abstractions which you don't need to scale up to understand what's going on with them.
And single-stepping and debugging and being able to run in a kind of in-vitro environment is really, really a useful feature that it doesn't seem like you're giving up anything, but you are when you don't have that ability to run it locally.
Absolutely. And if you can run it locally or in Docker, the chances that you can just say, you know what, I don't want to be in this cloud anymore. Some new opportunities opened up. Hetzner has a new local data center. DigitalOcean has something amazing and it's a fifth the price and just as fast or faster. Let's just move. You know what I mean? And if it's, well, we move our dockers and docker containers and our little system just goes over. That's one thing. If you got to rework serverless and queuing and all, like all of a sudden it's like, yeah, yeah, but no.
You
can still make use of technologies like serverless, right?
Like if you develop all your code as if it's a library that you're just like, and most of your logic is in kind of a neutral form factor where you can use it from a desktop app or a Docker container or a serverless container.
That's the, I like, it may not be worth investing that much in making that possible if that's not really your core competency and you don't need it, but it's not worth nothing.
And it's worth investing a little bit.
And often one of the points that I try to make in the talk is it's not actually that hard.
It seems really, really challenging.
But a lot of the times it's just because the desktop tools and the local development tools are not quite as well documented.
It's not as easy to Google for something and get immediate result for an error message just because not as many people are using them.
So there's a collective action thing here.
It's a call to action to get more folks involved in doing things locally because it makes the whole process easier for everybody else.
I 100% agree.
Before we jump too far from this whole server aspect you were talking about, are you familiar with Coolify?
I am not.
This is the first I'm hearing of it.
This is a pretty interesting open source project that is basically, I'll use their H2, an open source and self-hostable Heroku Netlify Vercel alternative.
So basically it's like some kind of Docker compose up sort of thing, but then it gives you the platform to get push into and host all your things, kind of like those places I named.
Oh, I might have to check that out.
Yeah, it looks pretty interesting.
And, you know, if you're thinking, well, we have more requirements, we got like we need continuous deployment and all these things.
Like look around.
I think there's a lot of interesting options.
And then this could go on EC2 or it could go on Hetzner or it could go on DigitalOcean or Linode or whatever, right?
There's a lot of interesting options here.
Just
one more thing on the whole local compute power part of this, which is that, because all of these alternatives that they're talking about have famously had drama with their free tiers and with the amount of compute that you get.
One of the other things, one of the examples I bring up in the talk is Twisted's test suite and just how much faster it can be if you run it locally.
And this is particularly of interest to the open source part of the Python community.
And the reason I'm raising it here is because free tiers are one of the places that you see this, right?
Like if you actually go all in in a kind of server-first workflow and you have a for-profit company and you're developing software that you have customers for, the local compute power argument does start to fall apart a little bit because it's like, well, you really can get like very, very powerful servers that can run your CI really, really fast.
But also you're not getting those for free in the GitHub Actions tier that open source projects have access to.
And particularly if you need to test on macOS and Windows, you're going to be paying for that.
If you are trying to subsist on free resources, you will often find they're very slow and heavily contended with a lot of other projects.
And so having the ability to run your tests locally to decrease the pressure on your free tier trial test host or your free tier GitHub Actions or CircleCI or whatever, The difference in speed there is huge because you're like way, way over provisioned in your local compute. And these providers who would really like you to pay a pretty penny for like the really fast stuff, a lot of us just like open source projects for logistical reasons often have to, even if the project does have some resources, we still need to stay in the like free tier of these things.
because like if your, you know, library has a big budget for CI, but all of your downstreams that are actually using it have to use the GitHub Actions free tier, you really want to be living there anyway, even if you could afford to live elsewhere.
Right. Otherwise it gets out of sync and things don't work. So yeah. Yeah. Cool. All right. Well, let's talk, let's talk desktop apps a bit. So give us some of the benefits of desktop first development. I mean, hotkeys, notifications, What else?
Those
are the big ones.
And there are, well, okay.
And there are other things.
Hotkeys, notifications, sounds.
Geolocation.
Geolocation, HUD overlays, right?
The ability to like put a window onto the screen.
The fact that you can do all of those things, right?
Like the presence of any one of those features, the ability to like pop up a window or whatever, like many of these things can kind of be emulated in web apps, right?
The browser is a really powerful deployment platform these days.
But the way that you develop something, if it is running locally, like case in point.
So there's this app that I'm developing called Pomodoro Boros, which I'm running right now.
It is a Pomodoro timer, and it puts a big old HUD overlay over your whole screen so that you do not get distracted.
Because I have ADHD, and if it's not in my visual field, it might as well not exist.
And so an app like that, not only can it remain running in the background, which like if you quit your browser, you close browser tab, it can go away.
And there's like no, you can summon it back if you intentionally want to.
If you as the user remember to relaunch that tab and repin it and put it in the right place and everything, like you can do it.
But first of all, speaking as a person of ADHD, I don't want to be doing that all the time.
And I physically can't sometimes.
But also just like even for, you know, neurotypical people with plenty of executive function, that's the computer's job.
Like the computer's job is to remember to run stuff, right?
Like, and you can have the app relaunch itself.
It can launch it login, right?
Like having a browser launch it login is a whole rigmarole.
It's like not impossible, but it requires lots of weird little hacks and it tends to be kind of fragile.
Whereas, you know, you can make an app that doesn't have a command Q or like Alt F4 quit, right?
Like you can have it go into the background and run by itself.
It can schedule cron jobs.
It can just generally keep itself running and automating away in such a way that if it needs to grab your attention again via a notification, via a geolocation hook, right?
Like you can not just do geolocation to geofence yourself, but also to like schedule your app to launch when crossing a geolocation fence.
That's a little trickier, but like it is definitely a thing you can do.
all of those things make it so that you can have code that runs when it needs to run and that you can interact with immediately right like you can have a cloud service like send you a push notification and like or a text message or whatever and try to remind you that you should do something but with a desktop app with something that's running locally even if it's running locally in your terminal right like one of the other things that i i have um i have a different app called PinPal, which is all about helping you memorize new passwords.
PinPal can actually run, I'm working on the desktop app version, but the other thing it can do is you just set it up in your PS1 so that if it's time to rehearse your passwords, it puts a little badge in your command prompt.
And so even if you're not going for the full high-touch desktop API integration, just the fact that it's running in my local shell on every time it displays the prompt, that allows it to be like much more present and something that I'm not going to forget.
And certainly for things that involve my development workflow, I'm not going to forget something that can be sensitive to what my working directory is, right?
Like it can activate things and deactivate things and make it so that like anything that I need to do, the local computation has already happened, right?
Like it's already done by the time I as the user am thinking that I need it.
This portion of Talk Python To Me is brought to you by Agency.
The agency, spelled A-G-N-T-C-Y, is an open source collective building the internet of agents.
We're all very familiar with AI and LLMs these days, but if you have not yet experienced the massive leap that agentic AI brings, you're in for a treat. Agentic AI takes LLMs from the world's smartest search engines to truly collaborative software. That's where agency comes in. Agency is a collaboration layer where AI agents can discover, connect, and work across frameworks. For developers, this means standardized agent discovery tools, seamless protocols for interagent communication, and modular components to compose and scale multi-agent workflows. Agency allows AI agents to discover each other and work together regardless of how they're built, who built them, or where they run. And they just announced several key updates, including interoperability with Anthropics, Model Context Protocol, MCP, a new observability data schema enriched with concepts specific to multi-agent systems, as well as new extensions to the OpenAgentic Schema Framework, OASF.
So are you ready to build the internet of agents? Get started with agency and join Crew AI, LangChain, Llama Index, BrowserBase, Cisco, and dozens more. Visit talkpython.fm/agency to get started today. That's talkpython.fm/agency. The link is in your podcast player's show notes and on the episode page. Thank you to the agency for supporting Talk Python To Me. And you can probably do automation accessibility things. Like you could have it run on a schedule or something when you're in your email or something like that. Like, hey, you're in your email. Remember that these two things need to be done now, but not, you know, not hassle you at seven or 8 a.m. or whenever you said to hassle you, but like when you're already doing the thing, right?
That's another thing you can do. I'm not even sure if I mentioned this one in the talk, but there are two things that the word notifications means in the macOS world, at least. There's a UN user notification center, which is where you send notifications to the user. But there's also notifications, which are, or NS notification center, which is like, just stuff is happening on the computer. Is your battery empty, like past a certain threshold?
Like you said, you're in your email, right?
You can ask the operating system, not just what's the front most window, but tell me when the front most window changes, right?
Like, send me an event.
And there are different operating systems.
Unfortunately, a lot of this kind of breaks down on Windows because Windows is, and
I say
this as unbiasedly as I can, kind of a misery.
Like there's so many just terrible APIs on Windows.
Everything's possible, but nothing is easy.
And so, unfortunately, some of the talk that can very quickly show these rapid examples on Mac and Linux is like, and then on Windows, here's this 900-page book that was published 20 years ago.
It's probably the way you have to go learn how to do it.
Calm in particular is really a challenge.
Let
me introduce you to the Win32 API and D column, and you're going to have a good time.
You
keep thinking like, oh, didn't they get rid of all that when they upgraded to the WinRT API?
It's like, nope, Windows is a sedimentary operating system.
There's just
layers, one on top of another.
Layers are formed.
They are not removed.
I don't want this to be like a trash-talking Windows thing because there's definitely ways to do a lot of this on Windows too.
There's message pumps that you can get from like, you open an HWIN in a foreign executable and you can kind of tell what it's doing.
Yeah,
you can hook into some interesting things there to like track other applications and so on.
You know, just to, I don't know if this will appease folks or not, to put a good word out there for Windows.
You know, you won't program your own stuff.
Like VB6 and some of these rapid GUI tools were ridiculous back in the day, even though they're not, I'm sure you could still build with them.
They're just like, I need a button here, a text box there.
And when I click this, I need that to become a web browser.
Click,
you know, and that's like two, two, three minutes and you're good to go.
Honestly, a lot of the stuff that is good about the Windows API, you end up kind of going through that portal back in time where you're like, how would I have done this in VB6?
And then you like, and unfortunately, as I'm not a heavy Windows user, one of the problems is that like the really good automation targets for Windows are frequently the things like Excel and Word.
And I don't have Excel or Word.
I got Steam and, you know, Windows Mail and a couple of, you know, open source applications in my Windows install.
But if you have, you know, there's also things like Excel wings and like, you know, people who are like heavy Windows users who have more concrete automation use cases for doing things locally.
There are a ton of ways that you can get really deep into a really rich API in a lot of the Microsoft first party applications.
Which again, this is one of those places where they're kind of like they're pushing people to kind of the web based Office 365 stuff.
And like they still have a big investment local desktop platform.
But a lot of people are kind of not using it as much.
If you get in there and you build a lot of workflows around that desktop stuff, Microsoft will notice.
They will want to support you in doing that.
And so, yeah, there are lots of tools there for getting what you need to do done.
The problem with Windows is really it's not as generalized.
Everything has its own API on Windows.
So you have to, on the Mac, I can tell you, there's a general way you can learn about an application.
And many applications have kind of a half-hearted implementation of it.
On Windows, it's much harder for a talk like mine to go and give a cursory level of like, hey, look at this Wonderland.
You can kind of get into lots of different things.
And here's some brief examples.
It's more like, no, no, on Windows, you have to kind of know what you want to do.
Once you know and you're willing to dig in really hard on a specific automation target, there's lots there, but it may be somewhat different from system to system.
Yeah, I haven't tried it, but a lot of the stuff that you would reach out and interact with for that stuff is in the com bunch of com objects component object model which are tremendously hard to build and get right but once they're there you can i think you can use them pretty easily you can probably use that from python pretty easily and then just look at the documentation for that thing this
is the tricky thing this is one of the things i'm enhancing for the next iteration of the talk is that is i dug in a little deeper on those tools there's a tool called called olay view which is an ancient tool if you bring that up and you start digging around in your local system, you can find a lot of these APIs. Win32.com is the, like, from PyWin32, gives you direct access to all that legacy stuff. And this is actually a kind of a great way of illustrating the Python's the second best language for everything. You know, like, older, if you're doing stuff with C# these days, like the modern Microsoft tool chain, they push you really hard towards WinRT and, like, the new way of doing things. And it's really difficult to get into the older, you know, com stuff because they're like, ah, that's deprecated.
It's not really, you know, it's not something you're using with.NET.
Like, you know, forget about that.
Whereas in Python, you can pip install WinRT, pip install PyWin32 right next to each other and be calling both different kinds of APIs.
And it's, you know, perfectly easy.
Yeah, yeah.
Again,
because nobody's setting out a roadmap for the Python community.
You know, those, and this is kind of what the, why I like giving talks about stuff like this.
If you're going to a conference and taking a tutorial, you could learn a whole new thing.
You can do a ton of learning in a three-hour tutorial.
If you're going to a conference talk, you're getting the...
Also, okay, can folks see this screen on the live stream, by the way?
On the live stream, they can't, not on the recording.
I do have to mention that Michael just brought up the Pi Win 32 page, and there are three maintainers, and the top one is me.
Because as much as I'm not a Windows guy, I'm on that list, actually, because when at the advent of binary wheels, I was the one who kind of went in and said, like, PyWin32 has got to have, like, downloadable wheels for every version of Python.
I built my own, like, fork of it because I couldn't get access for a while called PyPIWin32.
It was just, like, no code changes, just it's built and it has a bunch of hacks to get the paths right so that you could just import it without, like, changing your Windows path or manually opening DLLs.
So, yeah.
So I've been doing this for a long time.
That definitely does this calm stuff.
as well. So that's super cool. The
reason that I like giving talks about stuff like this is that you can give these pointers out to things where people have been toiling away, building all of this stuff for you in Python for years and years. There's PyWid32. There's Py, I think it's called, is it? Now I'm forgetting which one's the current one, but there's WinRT, the WinRT module on PyPI.
There's the Python D-Bus. There's like all of these different tools that people have built integrations for your desktop and your operating system and they're almost all like pretty recently maintained pyg object right like if you want to build new applications with the native toolkit for gnome pyobjc maybe yep pyobjective c and the pyobjective c is also a great example of like there are if you go if you search pypi for pyobjc dash framework you will find a zillion frameworks that are like all the things that have been wrapped so
that... Did I search the right thing?
Pi OBJC? Pi
OBJC.
Yeah, you dropped
the C.
Autonomous driving.
If you add a C to the end of the search, you will...
Yeah, and if you scroll down, there's like a ton of... Pi
OBJC core, mass shortcut, CF network. These are the accounts, these are the important subsystems of macOS, for example, right?
Right, and there are...
Dozens and dozens of them, right?
Yeah, like just scroll and scroll and scroll.
We're only to the Bs now.
Go with the 14 pages, let's go.
There's
tons and tons of stuff, like this whole universe that's available to you in Python.
And this is why this is like a kind of a, as much as we were talking about very generalized, like, oh, you know, local compute is really powerful and everything, like there's a general aspect to this, but there's a really Python specific aspect to this, which is there's all these libraries and tools that were not just developed as a proof of concept, but are consistently maintained and used pretty heavily in some niche areas where people really are using them in production, but they're not really talking about them all that much because they don't think they're of interest to the broader community.
They're not getting out there as much.
Nobody's excited about Browser Engine Kit, which is just that thing built into macOS.
And then, oh, I'm talking to it from Python.
Oh, okay, good for you.
It's not like I invented a new async web framework or anything, right?
Or
like here's my new system for integrating AI, you know, LLMs with cloud image generation and, you know, to defraud parking attendants or whatever the most recent, you know, hot startup is.
Or super high scale, you know, numerical computing or GP, it's not even called GP, GPU anymore.
It's just like parallel compute.
Not all these things make great individualized demos, but the infrastructure, there is a rich soil for you to plant all kinds of different applications in.
And actually, this is something that I have not brought up in the talk, but that is something that I would love to kind of get out there as an idea, which is I said like some of these tools, you use them, you get these weird error messages, and you kind of get stuck.
And a lot of people get stuck and bounce off attempting to use desktop stuff or local compute stuff because it's not as popular, so there's not as many resources, so people can't easily figure out how to use them.
But quite often it's worth doing that little extra bit of work to dig in and figure out what the problem is.
Because as frustrating and confusing as it can be to kind of trace through a traceback in somebody else's library that was like supposed to work and just isn't for some reason, doing that debugging and maybe contributing a little bit upstream to some open source thing that's a wrapper for the thing that you want to use is often not nearly as hard as like, oh, well, there's a really good Rust library for this.
Let me just switch the whole project over to Rust.
They're like, oh, this is really a Unity thing that I'm trying to do, so I'll just report all of my code to C#.
It's straightforward because there's tutorials for how to do that, and you don't have to go off by yourself to do this investigation.
But it ends up being a lot harder in many cases to go into a completely new ecosystem, redo all of the work that you've had to do, understanding the problem domain, debugging, getting some high quality code to do whatever your primary thing is just to access some new like binding to some library that is available somewhere else.
Yeah, those are definitely fraught with the danger.
I don't know if you've heard the big rewrite by Dylan Beatty, but I'll put it in the show notes.
It's a To the American Pie parody, which is like a six minute song.
And he goes through all the generations of rewriting.
It's incredible.
So just I'll put that as a warning to folks.
I haven't heard it, but I've
experienced it.
Yeah.
Then this song will connect with.
You know, one of the things when I'm looking at this PyPI listing here, it seems to me that as you're venturing out into these new areas that you're not super experienced with, like I know to do Python, but Objective-C, like didn't even macOS stop doing that?
I thought they did Swift, right?
There's still routes down to the same stuff, I'm pretty sure.
But you could go to your favorite chat coding assistant and say, how would I accomplish this thing accomplish in straight Swift.
It can give you the answers using some of these APIs.
And then you can say, now imagine there's a compatibility layer, rewrite it in Python.
I bet you would be pretty darn close, right?
As opposed to if you ask how to do it in Python, it might just go
haywire,
make up some crazy wrapper, right?
This is a place, so I personally have had just a series, like I am an, I guess, an AI skeptic.
One of my, the most popular articles on my blog is the grand unified theory of the AI hype cycle.
and there are i have concerns about the you know the energy use and the training data provenance the copyright issues and all kinds of you know social stuff like that but fundamentally i am trying to educate myself about these technologies i am trying to use them and like learn what they're good at i see some folks like simon willison having great success
yeah he's leading the way for sure stuff
and i try to do some of this stuff and they just face plant for me really hard all the time. I have never had an LLM successfully do something that I want to do, possibly because the stuff that the LLMs are good at, I can do in my sleep. And so I just like, I've already typed all the code the LLM would type for me faster than it could get it out.
And then I hit a problem like, oh, how do I do a business chat integration on macOS with, you know, PyOpC framework business chat. And it has no idea because there's no example code. It LLM is really good at doing a particular kind of thing with code.
Like if you're getting a lot of really solid, like quick, accurate, correct implementations, that probably means that there's just a ton of open source code that already does what you need.
Right.
And libraries and examples.
Yeah.
Right.
You'd probably be better off just using a library that did that.
And not to say that there's no cases where it can integrate two things, but it can integrate two things that are already kind of speaking the same language that are largely in the same area of the token vector space in the model, right?
Like there's overlap between the way that these things are expressed and being off the beaten path with some of these libraries that are less frequently used and that do require you to like know the Objective-C API, know the C# API, know the translation rule, and then express the thing in terms of the translation rule.
Like, yeah, it can be really, like you're definitely much better off in terms of both if you're using LLMs, using LLMs.
But also, even if you're just looking for reference material, learn the translation rules because they're often quite simple.
And then look for the example in the other language, even if you don't know the other language.
Like, I don't really know Objective-C.
I don't really, like, I mean, I know C and I, like, can kind of read it.
There's not actually all that much to Objective-C.
I definitely don't know C#.
And I've gone from, and C# definitely has some syntax.
Like, there's at signs and square brackets all over the place.
Yeah, a lot of symbols.
I
don't really know what this means, but it is nevertheless pretty straightforward to look up an example.
Because most of the examples for demos of doing the thing that you need to do with an API are going to be a flat sequence of method calls.
Or just do this, then do this, then do this, then do this.
And you're like, okay, well, I know it's dash greater, greater question mark for some reason.
I don't know why they're doing that, but that's the symbol in this language.
But I know that when I see that, that means I have to use two pairs of parentheses in Python or whatever.
That is a made-up example from a fake language, but there are lots of very straightforward translation rules.
And just as an example, there's pyobjective-c uses the objective-c runtime, which Swift also has its own stuff that isn't necessarily always exposed to this.
But the core of the frameworks is all exposed via the objective-c runtime to Swift in the same way that it's exposed to Python.
If you look at a method name, there's a rule, you replace all the colons with underscores, and then that's kind of the method name that you would use.
Rubicon, which is a different Objective-C bridge that works on iOS, has a similar set of rules.
They're not exactly the same, but once you know what they are, you can just apply them over and over again.
And if you can find an example of the C version, you can work out the Python version for yourself pretty straightforwardly.
Yeah, and I agree with you about the farther afield you go, the harder it gets, which is why I imagine like you try to get it to do it in the one language and you try to get it to help you convert that quick.
You know what I mean?
It's going to have a better chance than some super niche thing, I imagine.
Although
ironically, there, well, and, you know, in the PyJC docs, you get the same kind of like click on this tab for Python, this tab for Objective-C as you get in Apple's official docs where it's click on this tab for Objective-C, this tab for Swift.
It's a similar type of translation.
That's pretty handy, yeah.
But
when you have one of the things, so like at first it seems like, oh, this must be such a pain in Python.
You're constantly having to jump back and forth and do all this mental translation.
And while that is true, there's also the fact that if you're like writing a Swift app, like I've done relatively little of this type of development.
But like I have run through the kind of like Swift tutorials and whatnot.
So I understand I use Xcode.
I've done a bunch of stuff with code signing and like reverse engineering how to do that.
sometimes involves watching what Xcode would do and then trying to figure out what happened.
So I have done the kind of happy path version. And the thing is, you don't get a REPL with Objective-C or with Swift or C#, right? And the fact that you can, even though you do have to do this tedious translation sometimes for these types of APIs, it's almost the same thing as like, if you're just doing regular web development and you're reading a JSON API and the SDK is in JavaScript, right? You don't typically think of that as being like a laborious, difficult translation step. You just look at the JavaScript and if the JavaScript is not telling you what you need, you go and you just look at the HTTP underlying it, right? Like, and you know how to parse JSON and you know how to deal with HTTP resources. And it's the same kind of mental translation. This is a pretty straightforward thing that programmers do all the time without even thinking about it. And one of the things that makes Python a lovely language to do that, if you're working in a web context, is you, Python-M async.io or you run Python as a REPL and you just start fiddling around with some example data. You load it up and you start calling the APIs. And for a lot of these APIs, the difficulty of the extra translation step, the absence of a specific tutorial, is easily eclipsed and then some from the fact that you can do all of this development kind of iteratively and interactively in not necessarily even just a REPL, but also like a Jupyter Notebook.
Like a lot of these things, open up a Jupyter Notebook, start calling the APIs that you need to call, you know, record the output, have a look at what the OS is telling you.
There are exceptions to that.
In particular, in like, if you're doing like full-on desktop app development, sometimes you get into these weird places where like you really need like an app bundle on the Mac or you need like some registry keys set on Windows that point at a particular executable.
And so you do sometimes get into these places where like, okay, you kind of need to participate as if you're, living in the native developer ecosystem.
But even then, you can write yourself a little, you know, like write a Jupyter kernel that like you can connect to that just has that little stub executable on the side or has the app bundle that you can connect to.
And because there's lots of ways to programmatically create a REPL in Python, or even just if you don't even want to get that fancy, just a text field that'll eval some Python to interactively discover whatever it is that you need to learn about the API.
So you got a lot of powerful tools.
But again, once you've kind of determined like, okay, I'm just going to use Python for this.
I have this problem that I want to solve locally on my computer.
You can bring all of, you have to kind of bridge these gaps to do some things that would be a little bit easier if you were using the native tools.
But what you get for paying that cost is you get to bring all of your Python tools along with you and do all of this cool stuff that you already know how to do.
And on top of talking about the different ways to check it out, We've got really nice IDEs, right?
Especially PyCharm and VS Code and 100 variants of that thing.
You have really nice debuggers to go through and understand stuff on top of it.
And sometimes you do in other places, but sometimes you don't.
And maybe they cost money and you don't have that thing.
And
that process of having to learn a whole new debugger and a whole new way of getting your code to run, not to mention learning a new programming language, that's a big cost.
And it may not feel like it Again, it's straightforward.
It doesn't involve a lot of hard thinking to do all those tutorials.
But it does mean that, you know, you don't get to bring your superpowers with you.
Well, there's also a Node.js type of argument to make.
And that is, if you can write your desktop app in Python, and it happens to be talking to services you own, you can keep it in the same language.
Maybe not the same frameworks, because you're talking NS object sort of deals.
But still, it's closer to one unified programming language.
And
you can do it as much as makes sense, right?
Like you can have your, maybe it makes sense to use Positron, right?
Which is the Beware browser-based tool.
It's like Electron, but it uses Python instead of like the Chromium electron shell.
And so what that means is that you can say, well, I'm going to write like a Django app and I'm going to do everything kind of a plain vanilla backend way.
But I want this one thing from a local desktop app.
and so I'll write it mostly that way and then I'll use Positron and now I've got all the power of Python in addition to all the power of the web stuff that I was using and you can move that seamlessly from the back end to the local compute as you need it it's really that agility, that portability of you're not going to tell me where I can run my code that's the spirit that I would like to inculcate in anybody who hears this talk Because like, if you can run Python anywhere, nobody can tell you no.
I'm trying to think of the conference hat or t-shirt slogan for that one.
We're going to put down our Obey the GPO.
I'm going to put that one on.
Let's take just a couple of moments and talk about maybe three quick libraries that we could use.
And then I want to talk about LLMs actually just a little bit.
But let's talk about NotifyPy and then your two projects, QuickMac Hotkey and QuickMac App.
I'm not as familiar with Notify.py.
I've played with it a tiny bit.
I actually recently added, because macOS has some weird restrictions on the way notifications work, I actually just added a bunch of stuff to QuickMac app relatively recently to do notifications there.
But yeah, Notify.py, if what you need is a background notification, Notify.py is a much better place to start.
Yeah,
so it looks like a pretty simple API.
I haven't really done much with it either.
The one that I've used, which I had on the screen for a minute, but we never got to it is Rump's ridiculously uncomplicated macOS Python status bar apps that just live.
I've got one running right up in the status bar of my app right now.
And I love it.
Cool.
What does it do?
I find myself very often having to take things like, you know, over on Talk Python or for course recordings or whatever, like I have to take this title, developer trends in 2025 or whatever it is, and then turn it into kind of this, the slug that you might have up here, like lowercase, no symbol.
Something could be a file or a URL or something like that.
So it does a bunch of operations around that.
Like it'll, whatever is in the clipboard, it'll trim it, lowercase it, uppercase it, turn it to this slug type thing, or even make it pastable into Excel if it comes out of HTML, stuff like that.
That is exactly the kind of thing, like you just rattled off like nine different things that you need to do.
And it's such a simple thing.
I'm sure you did it probably a thousand times.
Oh, yeah.
It's so brutal to type it out.
And I'm like, oh, are you serious again?
You put that little status bar app in there and it just takes a whole element of pain out of your day.
Absolutely.
It uses rumps and it uses Piperclip and that's it.
And it's, but it's, it's not that advanced what it does.
I mean, some of them are literally one line return, string lower, string upper, string trim, but it's so good.
And you get to express it in a language you already know, right?
Like string lower, string upper, string trim, string, you know, title case, whatever.
Like there's so many things you can do in Python that are just one method that you just already know how to do, so it seems trivial.
But the number of keystrokes and motions on your keyboard and mouse movements to replicate that incredibly simple thing is like a lot, especially if you're doing it all the time.
So yeah, I guess Rumps would be a competitor to QuickMac app, probably.
It's really, really limited.
I think yours is more capable.
It's good if that's what you want, but you cannot ask much of it.
I mean.
One of the things that I'm doing, this is kind of veering off into a different talk and like other stuff that I'm doing, but I have also been trying really hard to do more of this stuff for real in a way to ship to other users.
This talk is more, what I'm going to be talking about at PyCon is more about doing exactly the kind of thing that you just said, like solving problems for yourself, using your local compute resources for you.
But I am simultaneously trying to productionize this stuff to provide examples of like, and you can take it further.
And because there are examples out there, like Dropbox was a Python app for 15
years.
And so clearly, if you want to, you can make pretty successful Python desktop apps.
But there are so few examples, and they're so far between, and they're so specialized that nobody's talking about the Python-ness of Dropbox.
That's not like a
talking point.
You may have the only desktop talk at PyCon, for example.
Not true.
But the one other that I'm sure is there is Russell, who's in the slot right against me.
That one time, I guess, is the desktop time.
But there is so much code out there.
I maintain hardly any of these libraries.
I have my two things, which are wrappers around other things that already exist.
All my stuff is higher level.
And I think you've probably used the phrase dark matter developers in the past.
Yes, I haven't thought about that for a while.
But yes, I love that phrase so much.
One
kind of dark matter developer are just the folks doing kind of workaday stuff in banks that don't go to, and insurance companies are not blogging or tweeting or xing or whatever about it, right?
They're just doing a job with some code and we never hear from them.
And they're like most Python programmers.
Case in point, right?
Like most of them use Windows.
But there's another version of that, which is like, there's a huge part of the open source community that's maintaining all kinds of packages to do all kinds of esoteric things with Python that we also don't, that aren't like plugged into the core development ecosystem that we don't necessarily see at conferences.
And those folks who are doing more specialized open source infrastructure deserve more celebration.
And desktop apps or desktop integrations are one part of that.
But there's lots of other signal processing things and other esoteric areas that not everybody needs.
And so they just have less of an audience.
But again, the fact that Python is the second best language for everything means that anytime you need to do two things at once, it's the best language.
And it's all those second tier folks that are out there doing the specialized libraries.
Like the generalized libraries, the, you know, Django's and Flasks and SQL alchemies of the world, like that stuff is super important.
And the language would absolutely not be what it is without that.
But we're all kind of aware of that stuff.
And it's that second tier that really makes Python like turbocharged powerful.
Right. You come to it in your little weird space of the world.
They already have libraries for that.
And we've all got something like that, right?
Like no matter what industry you work in, you're using some set of libraries for doing that stuff.
Even if you're working in like mass market social media or whatever, you're still probably using some cluster management tools or something that like not everybody is using.
That is that type of more specialized open source that's like still super important.
Let me riff on one more thing here real quick and see what you think about this.
So I'll tell you about an app that I wrote last week.
I think it was last week.
It must have been the beginning of last week.
It's been a little while.
is I want a program that when I'm working in a project in a Git repository, I can ask an LLM, do a better job than Michael's four words to summarize the commit I'm about to make to Git.
I want to say updated dependencies or more error checking, right?
But not what I did, why I did it, right?
I should do better, but I find in real life I don't.
And so I said, well, okay, what can I do?
well, I'm going to use this thing called LM Studio, which is cool because it lets you download stuff from Hugging Face, like most of the models that you know about, the llamas and the mistrals and so on, right?
But it also, the second tab that looks like a terminal, it runs a OpenAI compatible server on your local machine.
I have my Mac Mini that has the most RAM.
I just leave it running there.
And then anywhere on my local network, I can just use it to run code against.
And so I wrote maybe 100 lines of code that'll go through a git diff, take all those pieces, put a good prompt in front of it and send it over there and then get it back in a structured way that has like a title, but then a description below it.
If you go into detail, like GitHub supports and so on and cost nothing.
It doesn't really hurt the environment very much because it's just running for like four seconds on my local machine.
And my iStats menu says it uses seven watts for four seconds, which is like a LED light bulb for four seconds.
It's not nothing, but it's not melting the earth level of GPU usage.
You know what I mean?
So, and it's also local, so it's not sharing your data, right?
So I think that this, for people who are like, I want to build something local, but it kind of needs an LLM.
I think this is a pretty neat thing.
Whatever models you have installed, if you ask for them, it'll load them up and just answer your question with it.
It's pretty neat.
I do feel like there's still a pretty big, like one of the things that has stopped me from doing more stuff like that is really the, and this is really frustrating, attempting to like search around on Hug and Face, Because I feel like there are no what Simon termed vegan models that I can find.
The ones that are like all the data was collected consensually.
But if we could square that circle, and I think some people are working on that.
Again, like you said, seven watts for a few seconds.
That level of power utilization, not only is it less, but also you can know if you're, for example, I've got solar.
And so I know when it's basically free in terms of environmental impact.
Yeah.
And
I can run it at those times.
There's also the fact that if we could square the training data problem, you get the privacy concerns because it's not actually...
A lot of the privacy concerns with LLMs are just, it's a server.
Nothing to do with LLMs, right?
You're giving this data to another place and who knows.
You are giving it to Sam Altman, personally.
You can do what he wants with it.
The other part that's bad about LLMs is they could turn around and be turned into training data, which then gets turned as a result.
Not just they have it, but it might become the way that the thing speaks to others, which is even worse.
By doing local compute, you still have to worry about the training data.
You still have to worry a little bit about the environmental usage, but you can keep your own eye on it.
You can measure it and decide whether it's useful.
You're probably doing transparency effects on your desktop.
Yeah, just give people a sense.
Right now I'm doing a live stream.
So I'm doing screen sharing and you and I are talking and it's running at 17 watts on my Mac Mini.
So yeah, it's pretty mellow.
I think this solves two of the three problems, Glyph.
I think it solves or avoids pretty much the environmental effect, at least from running the questions, not training the models in the first place.
And it solves the privacy.
It certainly doesn't address what I generally consider to be more or less copyright theft that these things constitute.
but they already exist.
And you're saying like, I dislike that.
It's not going to make it go away.
It just means you're somewhat disadvantaged, which is a tough place to be, I think, honestly.
Another thing that I find LLMs often teach us this interesting lesson and this local models can actually make it clearer because they're worse, like because they're quantized down to be less powerful.
You can see this a little bit more, which is like that generating the commit message thing.
Like if that is being useful to you, than no shade or anything.
I think that's definitely better than just typing TK, TK, TK or whatever, which is probably what I'd do.
Just the letter A.
But it does also kind of highlight, well, the thing you really want to do in a commit message is you really want to say why, not what.
Because the what, the thing that the LLM can extract from the summary is always the less interesting thing.
And so quite often when you're asking an LLM to do something, that's a good hint that the interesting part is somewhere else.
and so it's useful to take a step back and on the commit message thing just say like why am I doing this?
Yes, absolutely.
So you know if I don't use the result when I ask the question it might at least remind me what I did with great detail so I can write a better message.
Sometimes it goes because we were no longer checking for the user possibly not being logged in which would have caused a crash I'm like dang, it figured that out.
Brilliant, that's the commit message you know what I mean?
But it's still, it's an interesting tool in the toolbox And being local, I think it counts as part of this story.
So I just thought I'd throw that out there because I've had a lot of success with that lately.
If we do figure out the training data thing, which again, there are people working on that, we will still need the local compute part of the story to have like a fully, like if we solve the training data thing and somebody does like a good fully consensual, like everybody's on board with the training data model, and then it's just running remotely and it's still a cloud service and you're still sending all your training data to it.
But like, well, so yeah, so having that, the power to run these things locally and leverage the power of local compute.
And as you said, right, like hook it in with an automation that you wrote again in Python, it having that agency and that power at your fingertips is super useful and a super important part of the puzzle, not just for like, like, and a lot of the complaints about LLMs are really just complaints about like automation and some of the problems with the computing industry and the internet more broadly and bringing your compute local and taking full control over and responsibility for it can really address a lot of those problems.
And I think it's something that we need to be thinking about all the time, right?
In the same way that when you're talking about, you know, a lot of the stuff we started off talking about with cloud compute, right?
Like, do you need to have, you know, all this, these esoteric services?
Do you need to have so many resources deployed if you're not even getting particularly good latency?
Could it
just
be in Funk Tools LRU cache decorator instead of a whole other service, right?
Could you just do it locally?
Could you do it radically more simply?
What if it was just a Python module?
Could you just make it a Python module?
And there's so many places, not everywhere, but there are so many places where the answer to that is yes, it could.
And in those cases where you can answer yes, you
should totally do it.
Well, very inspiring talk.
I will give a two-part call to action at the end of this, maybe three.
One, if you catch this on the YouTube live stream, go see Glyph's talk at PyCon.
That'd be great.
If you listen to this in the recorded version, edited and shipped to the podcast players, PyCon will be in the rearview mirror.
So look for the recording of his talk coming down to PyCon.
Or worst case scenario, check out the PyBay one.
What do you want to add?
People want to program their own computers.
You've been very inspirational.
They should follow me, glyph at mastodon.social, where I'm constantly talking about programming my own computer and all of the misery that comes along with it. And I also do some streaming.
You mean character
building?
Yes, yes. Character building. Learning. We're all, we're learning and growing. That's what we're doing. And yeah, I've got a couple of libraries. You mentioned QuickMac Hotkey, QuickMac App.
I've got a tool called Encrust, which is for code signing Mac
applications.
That is not to be underestimated. That is a huge roadblock to going from programming my computer to programming other people's computer.
I am using it in real life.
Speaking of, you know, we were talking earlier about people who like other folks in niche areas who are doing things with Python that you may not hear about as much.
One of my favorite things about Incrust is that Just Van Rossum uses it to ship some kind of app that has something to do, I'm pretty sure, with fonts.
That's about as much as I know about it.
But he is like actually shipping an app to users and I am using Incrust to ship a couple different apps.
They're still kind of alpha quality, but they're the sort of alpha quality that does like, and Crust also nowadays not only does the Mac App Store, or no, sorry, not Mac App Store.
So it still has yet to do the App Store stuff.
It does Mac notarization and it does code signing, but it also does Sparkle, which if you're not
familiar.
Oh, yeah.
This app has an update.
Would you like to install it?
Click enter to restart and install.
It
will generate and publish those.
Like it integrates the tooling to set that up for you.
And I did all the testing to make sure that you can ship an actual Python app and it installs properly and all that stuff.
And crusty, you don't say.
Sounds very cool.
Okay.
I've
been very Mac focused lately just because that's the platform that I use, but there's stuff in the works for Linux for some of those apps as well.
So yeah, I will hopefully have more to say and make it easier for folks to publish on their platform of choice.
But as much as I would love to point people at the one great project, once again, it kind of depends what you want to do.
You got to find that weird niche in the Python world, weird niche in the world that you care about the most, and then find the folks making it happen in Python because there's probably at least a few of them.
Get together, upgrade some of these tools, get them totally working.
Yep.
Then encrust your apps and ship them out.
Please do.
And let me know if there are bugs because there almost certainly are.
Thanks for being here as always.
Awesome to have you back.
Thank you so much for having me.
Bye.
This has been another episode of Talk Python To Me.
Thank you to our sponsors.
Be sure to check out what they're offering.
It really helps support the show.
This episode is sponsored by Posit and Posit Workbench.
Posit Workbench allows data scientists to code in Python within their preferred environment without any additional strain on IT.
It gives data scientists access to all the development environments they love, including Jupyter Notebooks, JupyterLab, Positron, and VS Code, and helps ensure reproducibility and consistency.
If you work on a data science team where consistency matters, check out Posit Workbench, Visit talkpython.fm/workbench for details.
And it's brought to you by Agency.
Discover agentic AI with Agency.
Their layer lets agents find, connect, and work together, any stack, anywhere.
Start building the internet of agents at talkpython.fm/agency, spelled A-G-N-T-C-Y.
Want to level up your Python?
We have one of the largest catalogs of Python video courses over at Talk Python.
Our content ranges from true beginners to deeply advanced topics like memory and async.
And best of all, there's not a subscription in sight.
Check it out for yourself at training.talkpython.fm.
Be sure to subscribe to the show, open your favorite podcast app, and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct RSS feed at /rss on talkpython.fm.
We're live streaming most of our recordings these days.
If you want to be part of the show and have your comments featured on the air, Be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Now get out there and write some Python code.