Latest / Talk Python To Me / #498: Algorithms for high performance terminal apps
Transcript
- 0:00In this episode, we welcome back Will McGugan, the creator of the wildly popular Rich Library and the founder of Textualize.
- 0:07We'll dive into Will's latest article on algorithms for high-performance terminal apps
- 0:12and explore how he's quietly revolutionizing what's possible in the terminal.
- 0:17From smooth animations to dynamic widgets and full-fledged TUI, or should we say GUI, frameworks.
- 0:23Whether you're looking to supercharge your command line tools or just curious about how Python
- 0:28can push the limits of text-based UIs. You'll love hearing how Will's taking a modern,
- 0:32web-inspired approach to old-school terminals. This is Talk Python To Me,
- 0:37episode 498, recorded February 4th, 2025.
- 0:42Are you ready for your
- 0:42host,
- 0:43please?
- 0:44You're listening to Michael Kennedy on Talk Python To Me.
- 0:48Live from Portland, Oregon, and this segment was made with Python.
- 0:54Welcome to Talk Python To Me, a weekly podcast on Python. This is your host, Michael Kennedy.
- 0:59Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython,
- 1:05both accounts over at fosstodon.org, and keep up with the show and listen to over nine years of
- 1:11episodes at talkpython.fm.
- 1:12If
- 1:13you want to be part of our live episodes, you can find the live streams
- 1:16over on YouTube. Subscribe to our YouTube channel over at talkpython.fm/youtube and get
- 1:21notified about upcoming shows. This episode is sponsored by Posit Connect from the makers of
- 1:27Shiny. Publish, share, and deploy all of your data projects that you're creating using Python.
- 1:32Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quarto, Reports, Dashboards, and APIs.
- 1:39Posit Connect supports all of them. Try Posit Connect for free by going to talkpython.fm
- 1:44slash posit, P-O-S-I-T. Will, welcome back to Talk Python To Me. It's great to talk with you.
- 1:49Thank you. It's good to be here again.
- 1:51It's going to be really fun.
- 1:52You know, I've built some really cool apps with Rich,
- 1:56and we're going to talk about Rich and Textual.
- 1:58Probably a little more on the Textual side this time around,
- 2:01but still a very, very cool revolution you're bringing to the terminal.
- 2:07Yeah, a very quiet but pretty revolution.
- 2:10I like it.
- 2:11Indeed.
- 2:12Okay, so we want to talk about Textual.
- 2:15You wrote a cool article called Algorithms for High-Performance Terminal Apps,
- 2:19which I thought would be fun to dive in,
- 2:21but we're going to also keep it more of a broad-ranging conversation.
- 2:24At the start of all that, you know,
- 2:26it's been a little while since I've had you on the show.
- 2:29Again, tell people who maybe haven't listened to that episode
- 2:33or episodes
- 2:33who
- 2:34you are.
- 2:35Sure. My name is Will McGugan.
- 2:36I'm a software developer, Python developer,
- 2:38probably like most of your listeners.
- 2:41I achieved a certain amount of infamy
- 2:45when I built this library called Rich,
- 2:47which a lot of people use.
- 2:49If you see some fancy output in a terminal,
- 2:51that might have been me.
- 2:53And I founded a startup called Textualize,
- 2:56which is all about improving the developer experience
- 2:59in the terminal.
- 3:00And I'm sure we'll discuss Textual,
- 3:02which is my other Python library in this show.
- 3:05Yeah, absolutely.
- 3:06I'm super excited for it.
- 3:08And is this close to the one-year anniversary for Textual?
- 3:13It was an anniversary of some sort
- 3:14because we're going to talk about one of your,
- 3:17one of your articles.
- 3:19It's actually
- 3:20closer to three years
- 3:22since I founded Textualize.
- 3:23Oh, no, you know, it's not,
- 3:25it's the 1.0 miles.
- 3:26Oh, right, yeah.
- 3:271.0 year, the 1.0 version.
- 3:29There we go.
- 3:30That's what I was thinking.
- 3:32Yeah, so Textual follows Semver,
- 3:35which I imagine people are familiar with.
- 3:37When you're on the zero version,
- 3:39you have a bit of flexibility
- 3:40and you can make breaking changes.
- 3:42We try not to,
- 3:43but you can make breaking changes
- 3:44and it gives you a bit of freedom
- 3:45early on to play around with things.
- 3:48But some people stick to
- 3:50ZeroVer just forever,
- 3:52which is fine if that's what you do.
- 3:54But when you go to 1.0,
- 3:55it advertises to people that this is stable.
- 3:58You can rely on the interface
- 4:00not changing too quickly.
- 4:04And if there are any changes,
- 4:05it's well documented.
- 4:07If you followed along,
- 4:08it's a very modest release
- 4:09from the last zero version
- 4:11to the 1.0 version.
- 4:13But it says to the world,
- 4:14hey, everything textualized is ready.
- 4:16You can start using it in production,
- 4:18even though you could probably have been using it in production for a year.
- 4:22I'm sure that you
- 4:22could have.
- 4:23I'm sure you could have.
- 4:24Are you familiar with zerover.org,
- 4:27the numeral zerover.org?
- 4:31Have you seen this?
- 4:32No, I didn't.
- 4:33I thought it was just an aspect of Semver.
- 4:35I didn't realize it was.
- 4:36It is absolutely an aspect of Semver.
- 4:39But this, I can't remember who put this together.
- 4:41Does it say at the bottom?
- 4:43Let's see about the About page.
- 4:45published yeah that's what i thought i thought it was Mahmoud Hashemi amazing yeah so Mahmoud put
- 4:50this together and basically it calls out
- 4:53i
- 4:54think it's it's a little contrarian to you know there's
- 4:57a lot of especially larger companies that have rules about what version you're allowed to use
- 5:03and is software ready enough if it's a 0.3 we can't use it it's not ready not until it's a 1.0 or a 2.0
- 5:09or something along those lines, right?
- 5:11And so this is
- 5:12the
- 5:14popular projects
- 5:16that are still really, really low in their versions.
- 5:19It says, welcome to Zerover 0.0.1.
- 5:23And if you go down here, it says, like, look, React Native is 0.78.
- 5:27Right, right, yeah.
- 5:28Even though
- 5:29it's 10 years old.
- 5:30Hugo, which I use for my blog and love it,
- 5:33it's got 77,000 GitHub stars.
- 5:35It was first released 12 years ago.
- 5:38More than a decade long.
- 5:40It's still zero dot something.
- 5:43Let's see if there's some that are really extreme here.
- 5:45I think the problem is that
- 5:47non
- 5:48-software developers
- 5:49have a different idea of what versions mean.
- 5:52We
- 5:53know that they're about compatibility.
- 5:56But when you're marketing it, 1.0 is like you advertise it,
- 5:59you make a splash about it.
- 6:01That's when it's actually
- 6:01out.
- 6:02You can use it.
- 6:02Otherwise, it's just like a toy, right?
- 6:05And then, boom, 2.0.
- 6:07Yeah.
- 6:07Yeah, let's see.
- 6:09NeoVim, 0.10.
- 6:11scikit-learn, it's 15 years old, it's 0.17.
- 6:15So I think I totally hear what you're saying, right, about like, yes, this, and I think we both agree, like, what this should mean.
- 6:22If your thing is 0.17, probably that means there's a good chance that there might be some adaptations to the API.
- 6:31at the same time if you're scikit-learn and you've had you've been around for 15 years yeah it might
- 6:37be time to bump that to something over 0.17 you know what i mean
- 6:41what
- 6:42do you think it's
- 6:42i
- 6:43think it's
- 6:44it's the um developer-led projects the ones which are just a bunch of developers releasing
- 6:49at open source uh we developers don't like to make too much promises exactly if we were to put a 1.0
- 6:55on it who's
- 6:56going to be on the hook for making that 1.0 and then they're stuck with it right
- 6:59Exactly. We know that 1.0 is not going to be perfect and bug-free.
- 7:05So we don't necessarily want to be on the hook for it not being perfect.
- 7:10Yeah, I know. At the same time, you're on the hook to not change scikit-learn at this point anyway.
- 7:16You know what I mean?
- 7:16And I'm only picking on them because I know they're so well-loved in the community and they're very, very common.
- 7:22Unlike, say, Ruff, which is on this list, but Ruff is pretty new.
- 7:26Anyway, I think I'll put this in the show notes.
- 7:29Zerover.
- 7:30Thanks,
- 7:30That was really fun.
- 7:32So let's talk about terminals.
- 7:35Terminal revolution.
- 7:36I think it's a pretty interesting time for terminals,
- 7:40both the application that runs your terminal
- 7:44as well as closer to what you're doing,
- 7:47building applications that are like CLI apps or TUI apps,
- 7:52as we'll coin the term.
- 7:54No, you've coined the term.
- 7:55We'll tell people about the term if they don't know, right?
- 7:58I mean, we've got Warp, we've got Ghostty,
- 8:02I don't know how you say, Ghostty, whatever.
- 8:04A bunch of other options coming along for terminals
- 8:07that make being in the terminal nicer.
- 8:10And I think also draw people into wanting to build apps
- 8:14that run in that space rather than try to get away from it, right?
- 8:17It's not macOS where it's just the default Z shell
- 8:23with no history and it's like white with weird fonts
- 8:26or CMD on Windows where you're like,
- 8:28what is this thing, you know?
- 8:30What are your thoughts on this?
- 8:31I mean, first of all, like maybe just on the apps that run,
- 8:33do you have a favorite terminal app that you run?
- 8:36I've been using iTerm for the last few years.
- 8:39It's kind of my daily driver.
- 8:41But there's a few other good ones.
- 8:42There's Alacritty and Kitty and then GhostTTY or GhostTTY.
- 8:47I'm not sure.
- 8:47That's a new kid on the block.
- 8:50And it is very good.
- 8:51It is very good indeed.
- 8:52but I like ITerms feature set
- 8:55it's not the fastest but it's fairly reliable
- 8:57and it's got lots of other features
- 8:59I played around with
- 9:02I
- 9:02played around with
- 9:03warp.dev as well
- 9:05I think that's a little too
- 9:09unconventional
- 9:09for me at the moment
- 9:11they've done some very cool stuff though
- 9:13there's lots of innovation there
- 9:14it takes some good news to you, that's the one I've been using
- 9:17last year or so and I really
- 9:19enjoyed it, it does some very cool things like
- 9:21For example, if I'm on my computer and then I SSH into another computer and then in that computer I Docker exec something into a Docker
- 9:29system,
- 9:32a Docker container, Warp will say, would you like to apply the Warp shell to this Docker container instead of whatever does it?
- 9:39It might not even have Bash, right?
- 9:40It might just be SH.
- 9:42You just hit a button and it goes, whoop.
- 9:43It adapts and basically become kind of like in memory, installs itself into that container temporarily, right?
- 9:50that sets all the
- 9:50settings
- 9:51and stuff.
- 9:52So it's a long ways from cmd.exe.
- 9:55I guess it's worth pointing out to people out there on Windows,
- 9:58if you're not using Windows Terminal, please,
- 10:02right?
- 10:02You need to use Windows Terminal.
- 10:05It's such an improvement over...
- 10:07Massive improvement.
- 10:09I mean,
- 10:09you probably run into this all the time, right?
- 10:12Yeah, and the solution,
- 10:13if someone tries something in the terminal
- 10:15they use is retro textual and it doesn't work properly,
- 10:18I first say, we try downloading Windows Terminal.
- 10:21And 99% of the time, it not only fixes it,
- 10:24but it makes it look beautiful.
- 10:26I mean, hat's off to Microsoft.
- 10:29They didn't change the terminal for decades.
- 10:32But when they did, they made a very good job of it.
- 10:34Yeah, it took a while.
- 10:36I don't know if it's the default yet.
- 10:38You know what I mean?
- 10:39I'm not sure what's actually presented
- 10:41if you kind of pull up the start menu.
- 10:44It's a very strange architecture.
- 10:47You can pull up cmd.exe.
- 10:50That's what I've been used to calling it
- 10:51because it has it in the title bar.
- 10:53If you send it some magic codes,
- 10:56you can switch it into essentially Windows Terminal.
- 10:58It'll process escape sequences like it does on Mac and Linux.
- 11:05So the actual window you see is just kind of like a window
- 11:09onto the thing which renders the terminal.
- 11:13So you can get Windows.
- 11:14You might already have Windows Terminal
- 11:15even if you don't get the experience.
- 11:18But software can switch it into this mode,
- 11:21which makes it work really well.
- 11:23I had no idea. That's cool.
- 11:25Okay.
- 11:25Yeah, it's probably the same core for both of them or something, right?
- 11:28Yeah, exactly.
- 11:29The architecture is very component-based
- 11:32and you can switch it at runtime.
- 11:35Yeah, that sounds very Microsoft.
- 11:37Is there a code that you can put to embed?
- 11:39Like if you can split the panes
- 11:41and then you can embed Excel on one side maybe
- 11:43and then SharePoint on the other?
- 11:44I haven't found it.
- 11:45I'm just kidding.
- 11:47I wouldn't be
- 11:48surprised, yeah.
- 11:49I wouldn't either.
- 11:50I wouldn't either.
- 11:52Are you a fan of modifying your shell, I guess?
- 11:56You know, like, ohmyzsh or
- 11:59ohmyposh or Starship or any of these?
- 12:03Yeah, to change the prompt.
- 12:05Yeah, I do have, I can't remember which one I use now.
- 12:08It's not, is it Starship?
- 12:09Yeah.
- 12:11Yeah, it's fairly minimal.
- 12:12It tells me the branch, the Git branch I'm working on,
- 12:16the version of Python that's running,
- 12:18and the version of the application I'm working on.
- 12:20So that's really nice.
- 12:22Oh, it'll tell you the version of the application you're working on?
- 12:24Yeah, it says v1.0.0,
- 12:26so it's somehow pulled out the version from Textual, I guess.
- 12:29Oh,
- 12:30wow. That's pretty cool.
- 12:31I guess if it's in a repo and knows that repo is a package,
- 12:33it can figure out what version it is, but that's still pretty neat.
- 12:36I guess. I must go on the spec.
- 12:38PyProject.toml, I'm guessing.
- 12:40Yeah.
- 12:41Yeah, I don't know. It's magic.
- 12:42and it works.
- 12:43So don't delve too deeply.
- 12:46Yeah, the whole reason I'm bringing this up,
- 12:48it might feel like a little bit of a diversion,
- 12:50but when people think about terminal apps
- 12:52and just being in the terminal
- 12:54and somebody says,
- 12:55oh God, I hate the terminal.
- 12:57It's so bad.
- 12:59I can't stand it.
- 13:00It usually means they're not adopting
- 13:02some of these really magical tools.
- 13:05Regardless of which one,
- 13:06regardless of whether you adopt Starship
- 13:08or Oh My ZSH or Warp or whatever,
- 13:11you get a dramatically different experience, right?
- 13:15Yeah, it's infinitely customizable,
- 13:17the terminal and the shell and various other software.
- 13:22So you can get the kind of experience that you want out of a terminal.
- 13:25People get very comfortable with their terminal environment.
- 13:29It feels like an old pair of shoes.
- 13:34It's just that comfortable.
- 13:36I guess it depends what tools you use as well.
- 13:38For example, if you're a NeoVim or an Emacs type person,
- 13:43you're in the terminal even way, way more than, say, for me, for example,
- 13:47use PyCharm and other tools that I only dip in and out
- 13:52when I'm working on code for that kind of stuff.
- 13:54Yeah, for me, I'm switching between terminal and VS Code most of the day.
- 13:58So
- 13:59I've got both
- 13:59open.
- 14:00I write some code and I switch back to terminal and run said code.
- 14:04So I'm in both.
- 14:06Yeah, but funnily enough, I never got into editors that run inside the terminal.
- 14:12I do like all the fancy graphics that VS Code can give you that terminal couldn't.
- 14:17Yeah.
- 14:17That matters less to other people, but I like it.
- 14:20You know what?
- 14:21When I started out doing programming, I started out doing a lot of work on silicon graphics,
- 14:26mainframes, doing Emacs on Onyx workstations and stuff like that.
- 14:31And I was happy as a clam to get out of there as quick as possible.
- 14:35get out of. I'm like, can I get some better tools than this? And yeah, I don't know. I'm on the GUI
- 14:42side as well, but I feel like kind of like the terminal. If you don't customize your terminal,
- 14:47it's not a great experience. If you don't really commit to learning all the hotkeys of your GUI app,
- 14:53well, it feels like, well, I got to use this mouse. It's all clunky, but like I almost never
- 14:56use the mouse. You know what I mean? Even though I'm in a GUI app, right? They just customize the
- 15:01keys? I
- 15:01think you can get very
- 15:03proficient in both.
- 15:05You know, I've seen people using a terminal and they
- 15:07use Emacs or Vim
- 15:09and their fingers just fly
- 15:11through it and they're very proficient.
- 15:13But the same thing in VS Code.
- 15:15If you know your editor
- 15:17and you know the shortcut keys and you don't reach
- 15:19for the mouse very often, you can be just
- 15:21as proficient, really.
- 15:23At Textualize, we had a policy if you use whatever
- 15:24you want to use to
- 15:25edit
- 15:27code. If you take a developer
- 15:29who uses Vim
- 15:31and then force
- 15:32them to Vs code,
- 15:32they will not be happy.
- 15:33And they will not be as
- 15:35efficient
- 15:36at
- 15:37all.
- 15:38Yeah, that's a really tricky balance, right?
- 15:40You want to let people work where they're comfortable, for sure.
- 15:45This portion of Talk Python To Me
- 15:46is brought to you by the folks at Posit.
- 15:48Posit has made a huge investment
- 15:50in the Python community lately.
- 15:52Known originally for RStudio,
- 15:54they've been building out a suite of tools
- 15:56and services for Team Python.
- 15:58Over the past few years,
- 15:59we've all learned some pretty scary terms.
- 16:02Hypersquatting, supply chain attack, obfuscated code, and more.
- 16:06These all orbit around the idea that when you install Python packages,
- 16:11you're effectively running arbitrary code off the internet on your dev machine,
- 16:15and usually even on your servers.
- 16:17But thought alone makes me shudder,
- 16:19and this doesn't even touch the reproducibility issues surrounding external packages.
- 16:24But there are tools to help.
- 16:25Posit Package Manager can solve both problems for you.
- 16:29Think of Posit Package Manager as your personal package concierge.
- 16:33You use it to build your own package repositories within your firewall that keep your project safe.
- 16:37You can upload your own internal packages to share or import packages directly from PyPI.
- 16:43Your team members can install from these repos in normal ways using tools like pip, Poetry, and uv.
- 16:49Posit Package Manager can help you manage updates, ensuring you're using the latest, most secure versions of your packages.
- 16:56but it also takes point-in-time snapshots of your repos,
- 17:00which you can use to rerun your code reproducibly in the future.
- 17:04Posit Package Manager reports on packages with known CVEs
- 17:07and other vulnerabilities so you can keep ahead of threats.
- 17:10And if you need the highest level of security,
- 17:13you can even run Posit Package Manager in air-gapped environments.
- 17:16If you work on a data science team where security matters,
- 17:19you owe it to you and your org to check out Posit Package Manager.
- 17:23visit talkpython.fm/ppm today and get a three-month free trial to see if it's a good fit
- 17:29that's talkpython.fm/ppm the link is in your podcast player show notes thank you deposit
- 17:35for supporting the show
- 17:36all
- 17:37right well i think that's a good transition to tui what is what are
- 17:43tuis why do people build them i know we talked about this in the last episode we won't totally
- 17:48necessarily rehash it but there are some people haven't seen it there are some incredible
- 17:51applications and we will see some built in textual that run in the terminal yeah
- 17:57sure so TUI stands
- 17:59for Text User Interface um i don't actually like that term anymore okay um and the reason is well
- 18:06the thing is um the TUI's that you build with textual are also GUI's um it's a very simplified
- 18:11form of graphics but we've got we've got lines um and and corners and you've got like a mouse that
- 18:17can move around. So it is rounded with text, but
- 18:22it works just like a GUI. I guess it's a little bit like
- 18:25saying a web browser is a document-based UI.
- 18:30It's technically correct, but no. We're having this whole video
- 18:34live stream recording across the internet,
- 18:38across the world in a web browser, and there's only a little text on the
- 18:41screen, right?
- 18:42Yeah, exactly. So the term TUI is stuck, but
- 18:45It's a GUI that runs in your terminal.
- 18:49Well, I think originally it was pretty text-based.
- 18:52It was.
- 18:52The advanced version might be a progress bar, right?
- 18:55Or emojis or color.
- 18:56Yeah,
- 18:57exactly.
- 18:57So those are technically text, but it looks like images.
- 19:01So you've got emoji.
- 19:02You can have lots of, like, I'm looking at my Starship prompt,
- 19:06and it's got a little snake because it's in Python and that kind of stuff.
- 19:09That is technically text, but it is graphical.
- 19:12and progress bars.
- 19:14You create a bar using characters,
- 19:17but essentially you're creating an image.
- 19:20So I think the distinction between
- 19:21text
- 19:22user interface
- 19:23and graphical user interface is fuzzy now.
- 19:27If you say TUI, I'll know what you're talking about,
- 19:29but I just don't like the term.
- 19:31I don't think it's as clear.
- 19:33I'm not sure we even need the distinction.
- 19:35Yeah, I hear you.
- 19:37Are you familiar with Btop?
- 19:38Have you seen this app?
- 19:39Yeah, that's really, really pretty.
- 19:41I like the fading effect.
- 19:43I mean, this app has just crazy amounts of graphics
- 19:49and it's all written in the terminal with live updating.
- 19:52I don't know how many graphs, but many, many graphs.
- 19:55Interesting thing about Btop,
- 19:57I think most people who run it don't run it
- 20:00because they really need to keep an eye
- 20:02on the performance of their course and file system, etc.
- 20:06I think a lot of them run it because it's retro cool.
- 20:09It's retro cool.
- 20:11It looks cool.
- 20:12It looks like how you thought computers were going to look.
- 20:17I'm going to be
- 20:17a programmer and a hacker.
- 20:19I'm going to be a super tech guy.
- 20:21This, yeah, you know what?
- 20:22It could be, this could be a movie UI.
- 20:24You know how when you're watching a movie,
- 20:26they're like, they fucked for whatever reason,
- 20:29won't run macOS or Windows.
- 20:32They come up with some weird variation that's got weird graphics.
- 20:36Yeah, and have some dialogue
- 20:37like,
- 20:38I've got to hack the Gibson.
- 20:39Okay, done.
- 20:40Exactly.
- 20:41I need to fill up something computer.
- 20:43This is Visual Basic.
- 20:44I know Visual Basic.
- 20:45I know this, yeah.
- 20:45I'm going to get his IP address.
- 20:46It's like, what?
- 20:47Yeah.
- 20:47I don't know.
- 20:49Oh, boy.
- 20:49Anyway, I think this is a really, really cool example of pushing way, way, way beyond.
- 20:55This is a graphical user interface.
- 20:57This is not a textual user interface, right?
- 20:59Exactly.
- 21:00I mean, technically it is text, but it's also graphical.
- 21:03Yeah.
- 21:04Yeah.
- 21:04Yeah.
- 21:05So we have two things that you guys make.
- 21:08We've got textual and rich.
- 21:10And maybe it's worth talking about Rich for a moment
- 21:12since that's the foundation.
- 21:13Sure.
- 21:14Okay, so Rich basically formats data
- 21:18in a very pleasing-to-the-eye way.
- 21:21You can print, say, a Python dict,
- 21:24and it'll format with an indentation.
- 21:26It'll colorize strings and things.
- 21:29And you can print things like tables quite effortlessly,
- 21:33syntax-highlighted code,
- 21:35and you can use up to 16.7 million colors.
- 21:40Essentially, it was a toolkit to prettify terminal output
- 21:43with as little effort as possible.
- 21:47And it's all kind of
- 21:48integrated.
- 21:50So you can put syntax-highlighted text inside a table
- 21:54or a progress bar inside a cell.
- 21:56And everything kind of works together.
- 21:58So it's a single coherent system.
- 22:00Because some of this stuff existed prior to Rich.
- 22:04But they were written by different authors.
- 22:06And they weren't designed to work together.
- 22:09Maybe there's a
- 22:09table
- 22:11one by one person
- 22:13and then a progress bar by another,
- 22:15and they didn't really work the same or integrate
- 22:17or things like that, yeah?
- 22:19Exactly, exactly.
- 22:20So it meant that terminal output was still quite basic.
- 22:26When color was used, it would colorize a single line
- 22:29or something like that.
- 22:31And it still,
- 22:31it
- 22:32helped,
- 22:34but it wasn't great for parsing,
- 22:37visually parsing that information.
- 22:38but Rich gave you that ability
- 22:41that when you write output
- 22:43it is readable
- 22:44I think prior to that we developers
- 22:47kind of built up this skill
- 22:49of staring at monochrome
- 22:51text with funny characters
- 22:53and numbers and somehow
- 22:55pulling out meaningful information
- 22:57out of that and it took years to
- 22:59develop
- 23:00but hopefully now we don't need to
- 23:02because you can write things to the terminal
- 23:05that looks much like the output
- 23:06you'd get in a browser.
- 23:08It's formatted and readable and colorful.
- 23:11Yeah.
- 23:11You know, one thing that might be worth talking about
- 23:14is the live updates, like live tables and stuff.
- 23:18Yes.
- 23:18So in Rich you can create a live object.
- 23:22That's what the class is called.
- 23:23And basically it clears the screen
- 23:26and it writes that output
- 23:28and then you can refresh it.
- 23:30It can do that quickly,
- 23:32like 20 times a second or less,
- 23:35depending on how much data you've got.
- 23:36So you can create animations, you can create dashboards,
- 23:40you can create like
- 23:41a
- 23:42scrolling list of text.
- 23:44But it was kind of, it was limited.
- 23:46Because all it could do is update information regularly.
- 23:49It wasn't interactive.
- 23:50You couldn't click or scroll or even detect key presses.
- 23:55It was purely for updating information.
- 23:58It's kind of like a very rudimentary predecessor
- 24:00textual.
- 24:02Another thing that's interesting is what's the frame rate?
- 24:06of a terminal.
- 24:08People think of it just kind of scrolling text
- 24:11and printing out text, and you see it kind of going by,
- 24:13and you're like, well, that's kind of how the UIs must be.
- 24:17But you can actually push these things pretty far, right?
- 24:19You can.
- 24:21The interesting thing is I don't think anyone
- 24:24who sat down to develop a terminal
- 24:26was thinking in terms of frames per second.
- 24:30They were just, they want to optimize the text output
- 24:35So that if you cut a large file, it didn't take forever to scroll through.
- 24:39Right, or didn't flicker around or something, yeah.
- 24:42Yeah, yeah.
- 24:43And later on, people like myself and others were creating animations and things.
- 24:49And they're thinking, well, how fast can I push this?
- 24:52And it turns out pretty fast.
- 24:54Because terminals use your GPU to render the text.
- 25:00And if you send a text fast enough, it'll keep up, mostly.
- 25:04And I found that 60 frames a second is completely workable
- 25:08on
- 25:08most terminals.
- 25:11You don't really need that for most apps
- 25:14because if you're scrolling text, you can only move character at a time.
- 25:18It's not pictal perfect because it's kind of like a grid.
- 25:23So if you want to scroll at 60 frames a second,
- 25:25you'd have to move 60 lines in a second,
- 25:28with which text would just kind of
- 25:29whiz by.
- 25:31Yeah, it gets blurry
- 25:31anyway.
- 25:32Yeah, so it can do 60 frames a second,
- 25:35which is sometimes fun for animation effects,
- 25:39but generally you don't need it.
- 25:41You can update 10 frames a second,
- 25:43and it'll look nice and smooth.
- 25:46But it's nice to know that you can.
- 25:47We've got a ridiculous demo,
- 25:49which creates a really colorful gradient
- 25:52and then rotates it at 60 frames a second.
- 25:55Wow.
- 25:56It looks very cool.
- 25:57It would be terrible in an actual app
- 25:59because it'd
- 26:00just burn your retina,
- 26:01but it is possible.
- 26:03Yeah.
- 26:04Reminds me of the early days when computers just started having VGA and stuff
- 26:08and people would come out with amazing
- 26:09graphical,
- 26:12what do they call them?
- 26:13I can't remember what they call them.
- 26:14Demos and things?
- 26:15I think I was thinking demos as well.
- 26:17Yeah, I think that is what they call them.
- 26:18And we would download them off of BBSs and watch them.
- 26:21We're just like, wow, it's so good on my 486DX.
- 26:23I can't believe it could do it.
- 26:25It's so smooth.
- 26:27They were amazing, right?
- 26:29Similar deal with the
- 26:29terminals.
- 26:30The manufacturer of those devices back then probably didn't have graphical animations or games in mind when they were building
- 26:39those
- 26:40computers.
- 26:40But then you got some interested parties who were willing to experiment and they actually managed to
- 26:45make
- 26:46it do things, which the manufacturer just never intended.
- 26:49The same thing with the terminal.
- 26:51No one ever sat down and created a system to display 16.7 million colors at 60 frames a second.
- 26:57It was other people that just tried that and got it to work.
- 27:01So there's an amazing amount of creativity and freedom in working and stuff like that,
- 27:06which I kind of missed from the old days because now computers are so fast and so powerful.
- 27:09I know.
- 27:09People don't have to even worry about it, do they?
- 27:14I want to kind of work through this.
- 27:16You have this live demo, the official textual demo, which you can still...
- 27:22Let me go.
- 27:22I think I have it in the next...
- 27:23No.
- 27:24If I click on it,
- 27:25it
- 27:26tells me how to get it.
- 27:28props for the install step here, the uvx.
- 27:32Are you a uv convert?
- 27:34Are you a uv fan these days?
- 27:36I am a fan.
- 27:37Yeah, I mean, that I think is a killer app
- 27:40that you can send someone a fairly short command line
- 27:43and they can run your project.
- 27:45The Python, it says --Python 3.12.
- 27:50That was because at the time,
- 27:52it wouldn't install a version of Python that it can run on.
- 27:56I think Astro's working on that.
- 27:58So I think in the future, maybe now,
- 28:00you could just do uvx textual-demo,
- 28:03and then it would just run.
- 28:05But even so, I think that's a beautiful way
- 28:08of allowing people to test your code
- 28:10with very little barriers.
- 28:13Yeah,
- 28:13especially the script stuff now.
- 28:16You can just use the script and
- 28:17put the dependencies
- 28:17at the top and just say uv run.
- 28:21I can't remember the exact syntax,
- 28:22but basically you can embed what it needs to run
- 28:25just as a comment and it'll run.
- 28:27That's excellent.
- 28:28It's no harder than it needs to be,
- 28:30which is great.
- 28:31It's very clear what it does
- 28:33and it works very well.
- 28:34It's the kind of computing that you want.
- 28:36You don't want to have to send someone
- 28:38a page of instructions
- 28:39and say, go and download this software
- 28:41and then write this into your configuration file.
- 28:44Yeah, that's just a headache.
- 28:45I don't want to deal with that ever again.
- 28:47I just want to send people what uvx, blah, and then done.
- 28:49I agree.
- 28:50I agree.
- 28:52If you have uvx,
- 28:53you're good to go, right?
- 28:55and you don't even have to have Python
- 28:56and you also don't have to worry about the version of Python.
- 28:59So these are all good things.
- 29:00So let's run it and let's see what happens here.
- 29:04There's a lot going on in this demo.
- 29:06Chris May out in the audience gives you props
- 29:08for making it so easy to run.
- 29:10And Hugo says, I can drop, I can drop the Python.
- 29:15As you imagined, I can just say uvx textual demo
- 29:18and I'll probably get 13.1.
- 29:19Let's see, something's happening.
- 29:21I think it worked if you had that version of Python.
- 29:24But if you didn't have the correct version of Python, it would sometimes fail.
- 29:28Got it.
- 29:28Maybe they fixed it.
- 29:29Yeah.
- 29:29Maybe.
- 29:30Maybe.
- 29:31So when this thing pulls up, it looks very much like a web browser.
- 29:38With the main difference, I think, that there's not a lot of pictures, as in true graphics, right?
- 29:44But if you imagine like a really nicely styled website that maybe used color and emoji and CSS, but just white on graphics, right?
- 29:54I feel like, would you say that's kind of the extent?
- 29:57It is.
- 29:57It's kind of like a minimal web interface that focuses on typography.
- 30:02That's not a potential because you've only got one
- 30:03font.
- 30:04Yeah, yeah, yeah.
- 30:05Exactly, you can't.
- 30:06Yeah.
- 30:07But as we'll see, you can actually do graphics pretty well.
- 30:12Yeah, if you see the numbers up at the top,
- 30:16there's nothing in the terminal that's placed.
- 30:18Most people are saying they won't know,
- 30:19but at the top it says version, then it says 100,
- 30:22GitHub stars 27.2 thousand
- 30:25how many forks and so on
- 30:26but those are colored differently
- 30:28they look different
- 30:29okay now tell us about the numbers
- 30:30yeah sure so they're taller
- 30:32and wider than the rest of the text
- 30:34but there is no alternative font
- 30:37in the terminal
- 30:38those numbers are made up of other characters
- 30:41box drawing characters
- 30:42so you've got like a vertical line
- 30:44a horizontal line
- 30:45you've got a curved corner
- 30:47you've got like a T section
- 30:49and you can assemble that
- 30:50and make it display something that looks like numbers.
- 30:53It does look like numbers.
- 30:56You've got the
- 30:57little subscript for the thousands,
- 30:59the kilo
- 31:00stars, I don't know.
- 31:03If I remember correctly, it's a two by three,
- 31:06no, sorry, three by three grid of characters.
- 31:09And I had to hand edit this in Python
- 31:13by cut and pasting the box characters from Wikipedia
- 31:16to assemble numbers.
- 31:18And I discovered the numbers work quite well.
- 31:20numbers look like numbers and i've also got hex digits so a b c d e f
- 31:26um
- 31:26i tried to keep going
- 31:28but i found that some characters didn't work at all um like an x there's no diagonal cross piece
- 31:34in these uh unicode characters so it's an x just became impossible with a three by three grid um
- 31:41but for numbers it works beautifully yeah yeah very interesting a
- 31:44little bit like a classical
- 31:46alarm clock where the numbers
- 31:48like a seven digit display.
- 31:50Yes, exactly.
- 31:51Yeah.
- 31:53Cool.
- 31:54All right.
- 31:55So if you run the demo,
- 31:57it comes up with comments
- 31:59that show you or sort of a
- 32:02walkthrough of what's possible
- 32:03in these little boxes.
- 32:04And it says, look, you can go
- 32:05and scroll it.
- 32:06You scroll with your mouse.
- 32:08You know, it scrolls that section.
- 32:10It says you want to go to the next one.
- 32:13Hit tab.
- 32:14Hit enter to open it up.
- 32:15It's, even though, kind of like we were talking,
- 32:18even though it's a user interface,
- 32:20like with scroll bars and I can grab the scroll bar
- 32:22and go to it and I can click on the things and so on,
- 32:25it's also very keyboard friendly, right?
- 32:28This is probably a super important aspect
- 32:29of building these types of applications in the terminal
- 32:33because people expect that, right?
- 32:34Yeah, very much so.
- 32:35So a lot of text was inspired by web development
- 32:39because I was a web developer for many years.
- 32:41And there's a lot of work being done
- 32:42in interfaces in the web world.
- 32:45Lots of work, you know, loads of developers working on it for years.
- 32:49I wanted to bring some of that to Terminal,
- 32:51but I also didn't want to lose what made the Terminal interesting.
- 32:55Terminal is a very keyboard-focused thing,
- 32:59so I wanted textual apps to also be very keyboard-focused.
- 33:03The mouse is terrific for discovering things.
- 33:06You know, you can move it around and there's tooltips, etc.
- 33:09You can click those links or you can press the key.
- 33:12But if you want to, if you use an app regularly,
- 33:14you'll want to learn the keys.
- 33:16So it is very focused.
- 33:17You can use the keyboard for everything.
- 33:21In the footer, that displays all the main keys.
- 33:24You can also use tab and shift tab
- 33:26to move around various elements.
- 33:28You can use up, down to scroll.
- 33:31So you could get by without ever using the term,
- 33:34without ever using the mouse.
- 33:36And it's there if you need it,
- 33:38but you don't have to.
- 33:39Yeah, that's incredible.
- 33:41It's got code highlighting.
- 33:43It's got a lot of different things.
- 33:46For people who maybe want to get started with this,
- 33:48I think there's two, let's say three,
- 33:50three things that are worth looking at.
- 33:52One, you actually, you said you were a web developer,
- 33:55so you must have been a fan of View Source, right?
- 33:57Oh, yeah.
- 33:58So you added, you basically added View Source.
- 34:01That's right, yeah.
- 34:01You type C, it says so at the bottom,
- 34:05and that pulls up the source of the current page,
- 34:08just like you would at my website or any website, right?
- 34:10Yeah, I want people to realize that the code behind that
- 34:13not that complex but textual it looks like complex um what you're viewing at the moment is actually
- 34:19markdown um which you might think that's quite hard to render markdown in the terminal and well
- 34:24it is but we've done it for you so um you just embed a widget and somewhere in the code it'll
- 34:29say yield markdown and then it'll have the contents and it renders markdown you see there's a code
- 34:36block there with syntax highlight code
- 34:37yeah well that's the magic of of these libraries right it's
- 34:41hard once for you and then it's easy for other people.
- 34:44Yeah. We suffer so you don't have to.
- 34:46Exactly. I feel like the most, the biggest example of that in the Python space is Jupyter Notebooks,
- 34:53right? All that interactivity and all that stuff, people are writing TypeScript and JavaScript and
- 34:58all these kinds of things, you know, it's for, you know, Plotly and other plotting UI things.
- 35:04And that's so Python people can write Python code and not write, you know, they're not creating
- 35:10websites are just typing in a notebook and they get
- 35:12interactive things, right? But that's
- 35:14probably the biggest take one for the team
- 35:16sort of deal.
- 35:16Yeah, there's a lot of work
- 35:18under the hood.
- 35:20A lot of people that use
- 35:22Jupyter Notebooks, that's their only
- 35:24knowledge of Python. They think Python is
- 35:26Jupyter and Jupyter is Python.
- 35:28And that's fine. It's a tool
- 35:30and it gives them access to
- 35:32all this stuff which would be very hard
- 35:34otherwise.
- 35:35So yeah, I think Jupyter
- 35:36is a great example of that.
- 35:38Out in the audience,
- 35:40And we have David points out JPTerm.
- 35:43Are you familiar with JPTerm?
- 35:45Yes.
- 35:46Is that David Brokert?
- 35:47Yeah, yeah, yeah.
- 35:48The successor of MBTerm, and it's Jupyter, Jupyter Lab in the terminal.
- 35:55Yeah.
- 35:56It's gone
- 35:57full circle.
- 35:59It's like the Inception movie.
- 36:02It
- 36:03really is, right?
- 36:04But you can embed the textual app inside Jupyter.
- 36:07So you could have Jterm working in a textual app inside Jupyter
- 36:11that's also displaying another notebook.
- 36:13Yeah.
- 36:16Incredible.
- 36:17All right.
- 36:18So if we go to the terminal where I got this running,
- 36:23and anyone else out there listening wants to check this out,
- 36:25you just run it.
- 36:26And I was starting to say there's three places you should check out
- 36:30before I got kind of starstruck with view code.
- 36:34Okay.
- 36:34So I think there's
- 36:35probably
- 36:36the best place to get started is to look at the widgets.
- 36:39I don't know what you think, but just like, well, what can this framework do in terms of what are the building blocks that you can look at the widgets?
- 36:45And then once you decide, okay, this is pretty interesting, I think people should check out the projects because there are some pretty interesting things.
- 36:52I know we've covered them on Python bytes that are built on top of textual.
- 36:56And then just to talk about the graphics, what is
- 36:59this game?
- 37:01This is a game in inverted commas.
- 37:05it's got different names
- 37:07sliding tile puzzle
- 37:08I think is the most common thing, you've probably seen it before
- 37:11you've got a square
- 37:13the square is made up of lots of little tiles
- 37:14and there's one space and you can move a
- 37:17square into that one space
- 37:19and the goal is to reassemble
- 37:21the image, but for here
- 37:23I've used code
- 37:25so you've got all these tiles with code on it
- 37:26and you've got to reassemble it
- 37:29into actual working code
- 37:31which I think is what most people think
- 37:32developers do. This is how we make code, just by
- 37:35sliding
- 37:36these tiles around.
- 37:38Yeah. I remember one of my daughters, I can't remember which one, saw me typing out code.
- 37:43And she's like, what are you doing? What is that? I'm working on this project, this program,
- 37:47this website. That's what websites look like. Okay.
- 37:51Yeah. My wife calls it the gibberish. She says, are you working on the gibberish? Yeah, I am.
- 37:57That's incredible.
- 37:58That's an amazing way to put it. Yeah. You know, I was just thinking the other
- 38:02the incredible power of text, right?
- 38:05You think of all these systems, the internet, Linux,
- 38:09configuration, source code, design,
- 38:11all of that is just words, right?
- 38:14It's not working with GUIs and all that stuff.
- 38:16It's just typing.
- 38:17Text is, yeah,
- 38:18very important.
- 38:19I quite like websites that skew graphics
- 38:22and have just kind of like typography-based thing.
- 38:26I find you can more easily extract the information you need.
- 38:30But most websites these days you go to
- 38:31and loads of ads, loads of image,
- 38:34they pop in and out.
- 38:35The text seems almost secondary.
- 38:39So I'm a big fan of just text in general.
- 38:43Yeah, same.
- 38:44All right, so people can play the game.
- 38:46That's kind of interesting, right?
- 38:47Like I said, I think where maybe it's more interesting
- 38:50is talking about the widgets.
- 38:52And when I look at this, you know,
- 38:53what this reminds me of is it reminds me of
- 38:56if I were to go over here and type Bulma
- 38:58and go, which Bulma is very refreshing.
- 39:01CSS framework that doesn't require build tools
- 39:05and shaking and webpack and all that junk.
- 39:10Or like Tailwind.
- 39:11Tailwind is kind of a pain to work with,
- 39:13but it's also super beautiful, right?
- 39:16When I look at this, the widgets,
- 39:19it feels very much similar to that, right?
- 39:21I'm sure people have checked out CSS frameworks.
- 39:23Yeah, that's...
- 39:25Yeah, tell us about it.
- 39:26Yeah, so I mean, you know, again, coming from the web,
- 39:30I want to have a web-like experience.
- 39:33Because everybody's familiar with the web.
- 39:34It's like you can sit someone down on a website
- 39:36and they'll be able to use it.
- 39:37I wanted the same thing for terminal apps.
- 39:40You know, some terminal apps have a bad reputation
- 39:42and have been hard to use, and it's mostly deserved.
- 39:45Like, you know, how do you quit Vim?
- 39:48It's a running joke.
- 39:50I don't know how to quit Vim.
- 39:51You reboot your computer.
- 39:52Everybody knows that.
- 39:53Come on.
- 39:54Exactly.
- 39:55I wanted, like, an interface that people were very, very familiar with.
- 40:00this is actually in alphabetical order
- 40:02but I think buttons was actually one of the first
- 40:04thing I developed
- 40:05because the terminal doesn't give you
- 40:08anything for free, the terminal is just
- 40:10text with escape sequences
- 40:12for colour and style
- 40:14like italic, bold etc
- 40:16but there's no escape sequence for a button
- 40:18the most simplest atomic
- 40:20user interface thing
- 40:21a button with a bit of text that you click
- 40:23there's nothing in the terminal spec
- 40:25for that, so you have to start from scratch
- 40:28and we built this button that looks buttony.
- 40:32It even has a 3D
- 40:34sort of raised
- 40:35effect
- 40:36and stuff.
- 40:37Yeah, so there's a lighter color at the top
- 40:39and a darker color at the bottom,
- 40:40and it looks like a classic Windows raised button.
- 40:45Imagine if this light is coming from the top
- 40:47and illuminating the top edge.
- 40:50Some people don't like them.
- 40:53I think one of the reasons is it has to take up three characters.
- 40:55In order to get that effect, you have to take up three lines.
- 40:59So it creates quite a chunky button.
- 41:01It looks like a button, but it's chunky.
- 41:04But you can style it very trivially to be one line long,
- 41:08so your button can just be as tall as it needs to be.
- 41:11Nice.
- 41:12Yeah, these are great, and we've got other things.
- 41:14I was thinking as you were talking about
- 41:16primitives you have to work with,
- 41:17I was thinking of pretty much every 3D rendered thing that people see,
- 41:22video games and others as well, animations.
- 41:26They're just triangles.
- 41:27There's just a bunch of triangles, which is so insane that you think,
- 41:30that thing that looks like a real forest,
- 41:32every single thing on the screen is some weird triangle
- 41:35with a texture and stuff applied to it.
- 41:37But a lot of triangles.
- 41:38Lots.
- 41:39You can't think too hard about how fast things are happening
- 41:42on graphics cards because your mind will melt.
- 41:44It's like there's so much going on.
- 41:47You've got check boxes.
- 41:48Is it all?
- 41:49Radio buttons.
- 41:50Radio buttons, which are great.
- 41:52A lot of the things that people might think about, data tables, you know, this is, if you're doing data science, I think one of the things worth talking about, because when we talk about some of the performance things, there's a lot of this within that within that, right? Like, like in your data table. So this whole UI, I can scroll up and down and see all the different widgets. But then when I get to the data table section, I can scroll horizontally and vertically within the data table itself,
- 42:18right?
- 42:18You can also press Control-A, and that'll maximize it.
- 42:21Oh, yeah.
- 42:22Very cool.
- 42:23I didn't even know about that.
- 42:24Yeah, this is a nice feature,
- 42:26which I think websites should have and GUIs in general.
- 42:29I remember Windows used to suffer from this.
- 42:30You'd get like a dialog where you had to enter a lot of text,
- 42:32but the dialog was this size,
- 42:35and you weren't allowed to resize it.
- 42:37You can't resize it.
- 42:39Yeah.
- 42:39Or you tap over and hope you hit the right button that you can't see.
- 42:42Yeah.
- 42:42So I added a shortcut key,
- 42:45which can maximize anything which is focused.
- 42:48can make it resize it to the size of the screen.
- 42:51Nice.
- 42:52Okay.
- 42:52In the interest of time, let's go and talk about projects real quick.
- 42:56I think one of the things that probably can inspire people a lot is some of these projects
- 43:02here.
- 43:02If you go to the project section, you've got a couple that are super nice here.
- 43:07For example, I would say this posting I know by Darren Burns is pretty interesting.
- 43:13This is like postman, right?
- 43:14Like an HTTP client, but entirely in your terminal.
- 43:16tell people about this.
- 43:17is great.
- 43:18Yeah, so this is something that
- 43:19Darren Burns built and he's
- 43:21a developer of, one of the
- 43:23developers, and he made a fantastic job of this.
- 43:25This is not a textualized project
- 43:28but basically it's Postman
- 43:30which is a tool for making
- 43:32HTTP requests. You might
- 43:33use it if you're developing an API
- 43:35and you want to experiment
- 43:37and you don't want to have to build all the tooling
- 43:39to talk to your API. You can just go straight
- 43:41into this interface and experiment
- 43:44and play around with it.
- 43:45I did that two days ago.
- 43:47Yeah, and it's super useful.
- 43:50And the fact that it's in the terminal
- 43:51is completely appropriate for this kind of application
- 43:54because
- 43:54that's
- 43:55where you're going to be a lot of the time.
- 43:58It just seems to be the right place.
- 43:59If you have your app in a browser,
- 44:02it can take you out of your flow if you're developing
- 44:05and having to switch over a window.
- 44:07But having it all on the terminal is super useful.
- 44:11And this project has sort of grown in feature set
- 44:14and I think it's comparable to some much, much larger projects,
- 44:18including Postman.
- 44:19Yeah, nice.
- 44:20And open source,
- 44:21right?
- 44:21Open
- 44:22source, yeah.
- 44:22Yeah, cool.
- 44:24What other ones do you want to give a quick shout-out to?
- 44:27Well, yeah, we'll go through them there.
- 44:28We've got Memray
- 44:30that was written by Bloomberg.
- 44:32They were an early adopter of Textual,
- 44:34and it's kind of a memory profiler,
- 44:36so it can run your Python application
- 44:39and it can pinpoint exactly what's taking up too much memory
- 44:43or if you've got a leak, you know, you're in a loop
- 44:45and you've been reserving objects, you don't know about it,
- 44:48it can alert you to that,
- 44:50which is very hard to actually debug without any kind of tool.
- 44:54So that's a fantastic project.
- 44:57I
- 44:58had them on not too long ago to talk about it,
- 45:00and yeah, this is a super cool project.
- 45:03I think also just graphically, it's pretty neat, right?
- 45:06Yeah, it displays all the information that you need
- 45:10right there in the terminal in a nice way.
- 45:13I mean, I can imagine a previous version
- 45:15of something like this writing out a big spew of JSON,
- 45:20which you then got to study to figure it out.
- 45:25We've saved a CSV file.
- 45:26Now you can look at it.
- 45:27It's like, oh, great.
- 45:28Yeah, exactly.
- 45:29But if you can look at it in a graphical form
- 45:30in a nice table,
- 45:31you can visually parse information much quicker
- 45:35so you can pinpoint things.
- 45:38We talked a little bit around this,
- 45:40But another huge benefit of these types of UIs with Textual
- 45:43is the ability to run them remotely on servers and other,
- 45:48or on a Raspberry Pi or on things that are embedded types of stuff
- 45:53that you just only access through the terminal, right?
- 45:56Like if you wanted to do memory on your web server,
- 46:00you probably don't want to just open up a bunch of ports
- 46:03and start serving, you know, a parallel HTTP request over it, right?
- 46:08But if you SSH in and you just run this GUI that's updating,
- 46:10it's really nice, right?
- 46:12Yeah, exactly.
- 46:14You don't even need to have a desktop.
- 46:16You don't need to run a server.
- 46:17And like I said, you don't need to set your firewall
- 46:19to allow a particular port and configure applications.
- 46:22All that's gone.
- 46:23Because it's a text interface,
- 46:24you just need to have a shell SSH into the server
- 46:28and then run it, and you can see this nice interface there
- 46:31because it is just purely text.
- 46:33And there's not much text involved.
- 46:35You'd be surprised about text that needs to be sent over the wire.
- 46:38is surprisingly minimal.
- 46:40If you compared it to a YouTube video
- 46:43of the lowest quality,
- 46:44I don't know what the lowest quality is,
- 46:45like 120p or something.
- 46:47Yeah, 360 by 240 or something.
- 46:50Who knows?
- 46:51Yeah,
- 46:51that would be vastly more data
- 46:53than a text interface like this.
- 46:55Yeah, even if it's madly updating, yeah.
- 46:58I mean, you could actually.
- 46:59You could if you want to push it.
- 47:00Like if I was to run this ridiculous demo
- 47:02with a spinning gradient at 60 frames a second
- 47:06and setting the screen size to ridiculous.
- 47:09It might turn into a video, but for most interfaces.
- 47:14But is it probably applicable for like GZip transfer as well?
- 47:19You know, text compresses really well.
- 47:21I don't know.
- 47:22True.
- 47:22It depends what you're rendering.
- 47:24I don't know if SSH does.
- 47:25I don't know.
- 47:26Maybe it does.
- 47:26I would think it compresses.
- 47:29Compresses and encrypts.
- 47:31Yeah.
- 47:31I would
- 47:32hope
- 47:32so.
- 47:32Yeah, well, compression should be cheaper than the encryption.
- 47:35So yeah, why not go ahead and compress it while I'm at it, right?
- 47:37Exactly, yeah.
- 47:38Yeah, yeah, yeah.
- 47:39Okay.
- 47:40So somewhere in here, we've pulled up so many things.
- 47:43I pulled up your article that I wanted to talk about as well.
- 47:46So let's talk about this.
- 47:48This was your, you said you wanted to write an article,
- 47:51sort of celebrate the 1.0 milestone for Textual.
- 47:54And the article was called
- 47:56Algorithms for High-Performance Terminal Apps.
- 47:58And I thought there was just some fun things to pull out of here.
- 48:01So I thought we could maybe talk through some of them.
- 48:03Yeah, sure.
- 48:03So there's lots of interesting technical problems to solve with Textual
- 48:08and lots of cool solutions.
- 48:10But I still rarely have the chance to talk to anyone about it
- 48:13because it's one of these things that's kind of under the hood.
- 48:15It just works.
- 48:16Yeah.
- 48:17There's nothing to discuss.
- 48:18So I wrote this blog post to describe some of the cool things that go on.
- 48:22The most core part of Textual is the compositor.
- 48:26This takes all the widgets.
- 48:28If you've got an interface, it might have data table, button, checkboxes.
- 48:35And there might be loads of those, and it might be able to scroll through it.
- 48:38And Textual has to take all those widgets and assemble them into a single update.
- 48:43Because there's nothing in the terminal that does a kind of a tiling window manager.
- 48:48You just write text to the terminal.
- 48:50So the software has to create this illusion that you've got windows and things that are overlapping.
- 48:57and that's essentially what the compositor does.
- 48:59That's
- 48:59great.
- 49:00And you've got transparency.
- 49:03Oh my goodness.
- 49:05Yeah, it's kind of magical.
- 49:06It shouldn't be possible in the terminal.
- 49:08It should not be possible.
- 49:09It cheats.
- 49:11You're not seeing true transparency
- 49:14because the terminal is not capable of it.
- 49:15You can't put an X on top of an A
- 49:19and then see the X translucently
- 49:21with an A in the background.
- 49:24But you can change background colors.
- 49:26So if you put something on top of background,
- 49:29you can calculate the transparency on top of the widget underneath it.
- 49:34So you can create the illusion of background of transparency.
- 49:39And that's something that the compositor does as well.
- 49:43Is textual pure Python?
- 49:45Pure Python, yeah.
- 49:47I had thought that at some point we would have to write something in Rust.
- 49:52And I bought a couple of Rust books, which I haven't read yet.
- 49:56But every time I got to a point where this is a bit too slow,
- 49:58I found a very good optimization in Python.
- 50:02So it turns out that it's just not necessary.
- 50:04I mean, if we were to write some core code in Rust,
- 50:08I don't think we'd get marvelous speed up.
- 50:10We might get 5%, 10% if we're lucky for a lot of effort.
- 50:14But since it runs on a lowly Raspberry Pi, it's not been necessary.
- 50:18Python's been more than fast enough.
- 50:20Yeah.
- 50:21And you can just ride on the coattails of the faster CPython team.
- 50:25Oh, yeah.
- 50:26Yeah, I mean, yeah.
- 50:27That helps too.
- 50:27A new
- 50:27version comes along, we can say Textual just got 10%
- 50:29faster.
- 50:31Textual has some sort of concurrency framework too, right?
- 50:35Yeah, so it's based on asyncio.
- 50:38And every widget from a button to a text area to a checkbox runs an asyncio task.
- 50:45So all these things are running concurrently, potentially updating the state.
- 50:50and Textual will update things
- 50:54according to the schedule of the widgets.
- 50:57You might have a widget which, say,
- 50:58updates 10 times a second,
- 51:00another widget which updates when you press a key,
- 51:03and another widget which updates infrequently.
- 51:07And Textual will combine those updates
- 51:10into a single update so that it looks clean,
- 51:13it doesn't flicker,
- 51:15and it's what does the magic of updating things.
- 51:20Yeah,
- 51:21awesome.
- 51:21That's super neat.
- 51:23I think UI frameworks and AsyncIO, Async and Await,
- 51:27they make a lot of sense, right?
- 51:28It's event-driven stuff, and so you can,
- 51:30instead of pulling or whatever, you just say,
- 51:32I'm going to wait until this thing
- 51:33has
- 51:34some kind of event,
- 51:35and then I'll work on it, and if that doesn't have an event,
- 51:38I'm going to go work on something else.
- 51:39Yeah, it's pretty cool.
- 51:40Yeah,
- 51:40exactly.
- 51:41It's funny that AsyncIO was obviously, you can tell by the name,
- 51:44it wasn't intended to build user interfaces,
- 51:47whether in the terminal or not, it was built for I.O.,
- 51:49but it's very good at handling concurrency of any kind,
- 51:55including text user interfaces.
- 51:56So I'm a big fan of Async.
- 51:58It's not perfect.
- 52:00There are a bunch of gotchas which come up in our support channels.
- 52:04For instance, someone will be playing around with Textual
- 52:07and will say, well, I'm going to need some long-running tasks,
- 52:10so I'll simulate this by putting a sleep in.
- 52:12We'll do like sleep 10.
- 52:14The whole app
- 52:15just locks up.
- 52:16I can't believe it.
- 52:17Exactly,
- 52:17exactly.
- 52:18So it's not perfect, but there is no perfect solution to concurrency.
- 52:23But I think it's as good as it can be with the current level of technology, I think.
- 52:28Yeah,
- 52:28yeah.
- 52:29Yeah,
- 52:30very neat.
- 52:31Free-threaded Python?
- 52:33Is it going to
- 52:34influence that
- 52:35kind of thing?
- 52:36I think so.
- 52:37There's a whole lot of cool things that free-threaded Python can do.
- 52:40We've kind of convinced ourselves that we didn't need that kind of level of concurrency,
- 52:43you know, from like a web application or something, because it's really linear.
- 52:49and the I.O. gives you concurrency
- 52:52in a sense because you're waiting for the I.O.
- 52:54But I think
- 52:56we need a better abstraction for concurrency
- 53:00because having to
- 53:01explicitly create a thread
- 53:03and run it requires that you think
- 53:05in terms of threads
- 53:08which is quite challenging.
- 53:10I think it should be
- 53:11the same as async.io. It
- 53:12should be async
- 53:13and await.
- 53:14I think that would be a marriage
- 53:16between them where like you don't really know as you're consuming it you know
- 53:19yeah
- 53:20unfortunately
- 53:21async io is single threaded you can use multiple threads but you've got to consciously write the
- 53:28code i would like to see an async io
- 53:29where it just distributed work
- 53:31across the course if it's if it's
- 53:35io based just keep it on the same thread but if it's computational based then like you're going to
- 53:39just put it on another thread and give me a future sort of thing to await and we don't care
- 53:43yeah
- 53:43Absolutely.
- 53:44Yeah.
- 53:44So I think in the future,
- 53:47we're probably going to get something like that
- 53:48because I think Python is so valuable
- 53:51that people are going to want to use it more
- 53:53and they're going to build these better abstractions.
- 53:56So I imagine in a year or two,
- 53:59maybe less,
- 54:00we'll have an asyncio that's rethreaded
- 54:04or something like it.
- 54:04Yeah.
- 54:05We say that we don't need it for web apps
- 54:07because we can just scale them out, right?
- 54:08We'll just run four of them, four worker processes.
- 54:11but there's a big memory cost to running.
- 54:14Well, I've got 16 cores,
- 54:16so I'm going to run 16 worker processes, right?
- 54:19They each take half a gig.
- 54:20All of a sudden, you're like,
- 54:21eight gigs just for this.
- 54:24Just so I can get computational parallelism, right?
- 54:27Yeah.
- 54:27Exactly.
- 54:28I mean, yeah,
- 54:29the IO gets you a lot of the way there,
- 54:32but sometimes you accidentally create CPU-bound code,
- 54:36which would run very poorly.
- 54:39But if you're using all our threads efficiently, then that should be easier.
- 54:43It should be easier, yeah.
- 54:44You know,
- 54:44it's super easy.
- 54:46Like, oh, I've
- 54:47got an ORM and I'm going to return 20,000 things that I'm parsing into Pydantic objects for FastAPI.
- 54:52All of a sudden, like, most of the work is the serialization that's computational.
- 54:57Anyway, all right.
- 54:57So let's get back to this.
- 54:59But I think that's super, super interesting.
- 55:01We could do a whole other hour on that.
- 55:03So one of the things in here you talked about is thinking in segments and not characters or stuff for drawing terminal lines.
- 55:12Let's talk about that because I really want to talk about the switching the primitive idea you got, but I think this is a good setup.
- 55:17Yeah, sure.
- 55:18So people who aren't familiar with inner workings of terminals might look at terminals and think it's like a two-dimensional array of characters.
- 55:26It does seem like that.
- 55:27And if you're building a textual app, you might think that you could compose a screenful of text like a bitmap, as if the characters were pixels.
- 55:37And as developers, that would be like stuff we're very familiar with.
- 55:40We could easily build that
- 55:42and
- 55:43create stuff with it.
- 55:46But the problem is that terminals aren't two-dimensional arrays of characters.
- 55:50And it's for one reason is that some characters take up twice as much space as others.
- 55:56Chinese, Japanese, and Korean tags typically take up two characters
- 55:59because their characters are more complex.
- 56:01They deliver more information in a single character,
- 56:03so they have to be wider.
- 56:05There's also emoji, which many emojis can take up twice as much space.
- 56:11I'd have the snake emoji.
- 56:13Exactly.
- 56:14I think that might be two.
- 56:16I don't know how wide it is.
- 56:18Some emoji are one, like a smiley face or something,
- 56:21but some emoji are two.
- 56:24And if you were to treat it like a two-dimensional ray,
- 56:27it kind of falls apart at that point
- 56:29because if you subtract one from the Y coordinate,
- 56:32it's not directly above the original coordinate.
- 56:36So in situations like that,
- 56:38rather than trying to fudge
- 56:39things
- 56:40into the primitive
- 56:42that you first thought of,
- 56:44you can come up with a new primitive,
- 56:46a new way that represents the very lowest common denominator
- 56:50of thing you want to do.
- 56:52And for textual, that turned out to be segments.
- 56:55So rather than a character, it's like a pixel.
- 56:58We use a segment.
- 57:00A segment is a string, any number of characters, plus a style.
- 57:04And by assembling these segments, you can represent anything in the UI.
- 57:10And all the operations which are done are kind of built on segments.
- 57:15So I call this switching the primitive,
- 57:17because the original primitive was like a character's a pixel, right?
- 57:20Which didn't work.
- 57:21If you were to, you could use that with a bunch of fudges to build on top of it,
- 57:27but you might find that it falls apart.
- 57:28Things which should be straightforward suddenly become really complicated.
- 57:32And that's because as developers, we tend to layer primitives on top of other operations.
- 57:37And if the very foundational primitive doesn't represent your problem very well,
- 57:42then it can fall apart.
- 57:44So the switch from pixels to segments worked very well with Textual.
- 57:48and Textual is essentially a segment processing engine.
- 57:51Everything the compositor does takes in a bunch of segments,
- 57:55manipulates them, spits out new segments,
- 57:57and then those get turned into escape sequences.
- 58:00Yeah, very cool.
- 58:02I think this idea of switching the primitive,
- 58:04you know, people who are new to programming or new to Python,
- 58:07especially programming, I have a hard time.
- 58:11I see the code, I look at someone else's code,
- 58:13and I see the code, and it makes sense,
- 58:15but then when I sit down with a blank screen and try to solve a problem,
- 58:18I'm stuck. I don't know what to do.
- 58:20And this switching the primitive concept of like,
- 58:22we looked at it this way and it just seemed so complicated and intractable.
- 58:26And then I decided to rejigger maybe the data structures
- 58:29and how we organize stuff and how we combine them.
- 58:31And boom, it just unlocks simplicity, actually.
- 58:35Kind of like going back to our triangles and graphics.
- 58:37It's like, well, if you think in pixels, 3D game engines are impossible.
- 58:41With ray tracing and lighting and shadows,
- 58:43you think in triangles, all of a sudden it unlocks it, right?
- 58:47this sounds a little bit similar, and I think
- 58:49that's a pretty valuable lesson for people to take.
- 58:51That's exactly right. So if you had
- 58:53a game engine, and the only
- 58:55function it had was like put pixel,
- 58:58it would be a nightmare
- 58:59to build anything but the most trivial
- 59:01games, but the primitive of
- 59:03a triangle means you can build 3D
- 59:05anything. So that is the bare primitive.
- 59:07And they have angles, so they have reflection,
- 59:09and so they have all sorts of stuff, yeah.
- 59:11Yeah, something similar came up when
- 59:14Darren was building the text area.
- 59:16So the text area has lots of operations,
- 59:18like insert a new line, delete a character,
- 59:22delete a line, delete a paragraph, cut and paste, etc.
- 59:26And the primitive for that boiled down to a very, very simple primitive,
- 59:30and that was replace a range of text with new text.
- 59:34It's like anything you can do to a text area
- 59:36comes down to that primitive of a range plus new text.
- 59:40Like to delete something, you replace a range with an empty string
- 59:44to insert something.
- 59:46You replace a range with
- 59:48the insertion character,
- 59:50like a new line plus the previous
- 59:52string. So everything boils down to one
- 59:54very simple primitive.
- 59:56And once you've found the right primitive,
- 59:58bigger problems become much, much easier.
- 1:00:00Yeah, 100%.
- 1:00:02It's amazing the way it works.
- 1:00:03So we'll get short on time.
- 1:00:05We got, pick one more
- 1:00:08lesson from here that you want to
- 1:00:09talk about maybe. The spatial
- 1:00:12map was quite interesting.
- 1:00:13Yeah, I think they do.
- 1:00:14A bit further down, yeah.
- 1:00:16So one of the problems we had in textual,
- 1:00:18when interfaces get complex,
- 1:00:20we've got lots and lots of widgets.
- 1:00:22Some of them are visible and some of them are not.
- 1:00:24Some of them are scrolled off.
- 1:00:26They're still there in memory.
- 1:00:27We know exactly where they are.
- 1:00:30And when we come to render that,
- 1:00:31the most obvious way to do that
- 1:00:32is to step through them in a for loop
- 1:00:34or widgets in all widgets,
- 1:00:36do stuff to widget.
- 1:00:39But that means we're iterating over all the widgets
- 1:00:42every single time,
- 1:00:43even if they aren't visible.
- 1:00:46So the spatial map was an attempt to optimize that.
- 1:00:48Basically, it's a very quick way of deciding
- 1:00:51which the widgets are on screen
- 1:00:52and which the widgets are currently scrolled off.
- 1:00:55So we literally don't need to even loop through
- 1:00:57the scrolled off widgets.
- 1:00:59And the way we did that briefly
- 1:01:01is we kind of logically separated the terminal
- 1:01:04into a grid.
- 1:01:06There's a step where you go through
- 1:01:08and assign every widget to the grid squares
- 1:01:11that it might overlap with.
- 1:01:13small widgets might be right inside a grid square some may overlap one or two or more and then once
- 1:01:19we've got that information it's very easy to pick out which widgets are visible and exclude which
- 1:01:25widgets aren't because we can take the screen figure out which of the grid squares it covers
- 1:01:31and then we can go through those grid squares and there's probably just a handful of them and each
- 1:01:35of those grid squares is associated with a list of widgets which are under that
- 1:01:38you
- 1:01:39can combine that
- 1:01:40with a set and then very quickly
- 1:01:42you reduce that problem domain
- 1:01:44from being potentially unbounded very
- 1:01:46large to like very small
- 1:01:48some of the widgets might actually not be visible
- 1:01:50they might actually be in a grid square which
- 1:01:52is off the edge of the screen
- 1:01:54but we can just loop through those
- 1:01:56and discard those ones
- 1:01:58but that's a much smaller operation
- 1:01:59than
- 1:02:00looping through every widget
- 1:02:02in the location. Interesting. He talked about
- 1:02:04it's fast enough in Python
- 1:02:06and it's this kind of stuff that makes it fast enough
- 1:02:08in Python right? If you rewrote this in
- 1:02:10other native compiled language,
- 1:02:12it
- 1:02:13would be faster to go through every single one of them,
- 1:02:15but you're still potentially processing
- 1:02:17a tremendous number of things,
- 1:02:19and you get the compositor and overlap
- 1:02:20and all those kinds of things,
- 1:02:21and you're really worried about stuff
- 1:02:22that's way off the screen.
- 1:02:24Instead of going, we're going to rewrite it,
- 1:02:25you can just think, let me think about
- 1:02:27the right data structures and the right algorithms.
- 1:02:29Exactly.
- 1:02:30And so on, yeah.
- 1:02:31I mean, I would love it if Python
- 1:02:33just got so ridiculously fast.
- 1:02:34You don't have to worry about that,
- 1:02:35and I'll take any speed improvements again.
- 1:02:39But the optimizations you can produce yourself
- 1:02:41just by having the right algorithm,
- 1:02:43they tend to outweigh the benefits you could get
- 1:02:46from, say, running it in C.
- 1:02:48First, it would be implement that in C.
- 1:02:49It would obviously be faster,
- 1:02:51but it would still be much faster to have that algorithm.
- 1:02:54Yeah, exactly.
- 1:02:56I'll take my order of O squared
- 1:02:59versus your O factorial versus N squared.
- 1:03:03You know what I mean?
- 1:03:04Exactly.
- 1:03:05It's going to lose
- 1:03:06on N factorial no matter what you do, right?
- 1:03:08Yeah.
- 1:03:09I mean, Python wins because of the speed of development.
- 1:03:11We know it's not the runtime speed.
- 1:03:13Yeah, absolutely.
- 1:03:13The runtime speed is okay most of the time,
- 1:03:16but it's the speed of development.
- 1:03:17The fact that you have got more time to pick the right algorithm
- 1:03:20means it's not as slow as people might think.
- 1:03:23Yeah, absolutely.
- 1:03:24It doesn't get too complicated.
- 1:03:26Yeah, thinking about this,
- 1:03:28I think there's a lot of
- 1:03:28parallels
- 1:03:30back to game engines
- 1:03:31that I think about a lot.
- 1:03:32The game engines have this thing called oct trees,
- 1:03:35like basically break stuff into eight squares,
- 1:03:38and you say, well, which I'm looking for a thing
- 1:03:41if it's going to say intersect with this, right?
- 1:03:43Because it's like for hit detection and stuff.
- 1:03:44Like, well, is it in this half of this world
- 1:03:46or that half?
- 1:03:47Well, it's in this half.
- 1:03:47Okay, well, we're not even going to compare it
- 1:03:49against half of the things in the world
- 1:03:50that are in that half.
- 1:03:51Now, look at the hash, right?
- 1:03:53Like you can super quickly go,
- 1:03:55I have a million objects on screen,
- 1:03:57but I can determine if this thing hits it
- 1:03:59with five comparisons or something like that.
- 1:04:01You know what I mean?
- 1:04:02With just the right data.
- 1:04:02That's exactly it.
- 1:04:03It's super interesting.
- 1:04:04Yeah, yeah.
- 1:04:05It's probably no coincidence that I used to work in video games.
- 1:04:10Oh, did you? Okay, yeah.
- 1:04:11Yeah.
- 1:04:11So that was kind of my mindset.
- 1:04:13It's like reducing the problem.
- 1:04:15And Textual is quite a lot like a video game.
- 1:04:17If you imagine like a 2D video game that's got lots of sprites that are over here,
- 1:04:21we don't want to worry about those.
- 1:04:22Yeah.
- 1:04:22Replace sprites with widgets, and it's pretty much the same problem.
- 1:04:25Yeah, yeah, exactly.
- 1:04:25It's the same kind of mindset.
- 1:04:27It certainly is.
- 1:04:28All right, well, I think we're going to need to
- 1:04:29just kind of wrap it up here
- 1:04:31because I think we're getting short on time.
- 1:04:34Let's leave everyone with roadmap.
- 1:04:38Where, you know, you've hit this 1.0 milestone with Textual.
- 1:04:41Where are things going?
- 1:04:42So there's a whole bunch of features which I want to implement.
- 1:04:46I mean, Textual is usable as, you know, you can build fantastic apps,
- 1:04:49but there are a few things where we don't have parity with web apps.
- 1:04:53Something I've implemented on a feature branch is arbitrary text selection.
- 1:04:58So, you know, on a website, you can just draw your mouse over text you want to select.
- 1:05:03That didn't work well with TUI's.
- 1:05:06If the terminal did it,
- 1:05:07if the terminal doesn't understand the logical separation of widgets,
- 1:05:11it would just copy all the text on that line,
- 1:05:15which might get parts of one widget and parts of another.
- 1:05:18So I've implemented Arbitrary Text Selection,
- 1:05:20which seems to work quite well.
- 1:05:22And it's such a fundamental feature, I think.
- 1:05:23Wow.
- 1:05:24It'll make Textual more useful.
- 1:05:26Yeah, I guess if you've got
- 1:05:27a UI in Textual,
- 1:05:29and you're like, I need
- 1:05:30to get that and paste it into another document
- 1:05:32or search it, you know, highlight the map,
- 1:05:35the address to put in a map or something, right?
- 1:05:37Yeah, and things like, you know,
- 1:05:39if you're using Textual to talk to an LLM,
- 1:05:41an LLM writes some code,
- 1:05:43you don't want to transcribe that code visually.
- 1:05:46Yeah, and so now we can be able to like,
- 1:05:48we can select the entire code.
- 1:05:49You could add a button,
- 1:05:50but it's very convenient to drag.
- 1:05:53So that's something that's coming very soon.
- 1:05:56And yeah, there's a whole bunch of features I've got,
- 1:05:58which I'll be working on.
- 1:06:00Yeah, watch this space.
- 1:06:01Excellent.
- 1:06:02And PRs accepted, contributions accepted?
- 1:06:05Very much so, yep.
- 1:06:07There's a big pile of them there,
- 1:06:08but I tend to work on a big feature
- 1:06:11and then spend a few days going to the PRs.
- 1:06:13And I love to have PRs.
- 1:06:14It means that people are very interested.
- 1:06:17And it saves me time, of course.
- 1:06:18If someone else is fixing bugs and writing code,
- 1:06:21then it's a great thing.
- 1:06:22Awesome.
- 1:06:23All right, well, thanks for coming on,
- 1:06:25giving us an update on Textual
- 1:06:26and all the stuff that you guys built.
- 1:06:28It's super valuable to people.
- 1:06:30Always a pleasure.
- 1:06:30Thank you very much.
- 1:06:31Yeah, you bet.
- 1:06:32See you later.
- 1:06:32Bye-bye.
- 1:06:33This has been another episode of Talk Python To Me.
- 1:06:37Thank you to our sponsors.
- 1:06:38Be sure to check out what they're offering.
- 1:06:40It really helps support the show.
- 1:06:41This episode is sponsored by Posit Connect from the makers of Shiny.
- 1:06:46Publish, share, and deploy all of your data projects that you're creating using Python.
- 1:06:50Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quarto, Reports, Dashboards, and APIs.
- 1:06:57Posit Connect supports all of them.
- 1:06:59Try Posit Connect for free by going to talkpython.fm/posit, P-O-S-I-T.
- 1:07:05Want to level up your Python?
- 1:07:06We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:07:11Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:07:16And best of all, there's not a subscription in sight.
- 1:07:18Check it out for yourself at training.talkpython.fm.
- 1:07:21Be sure to subscribe to the show, open your favorite podcast app, and search for Python.
- 1:07:26We should be right at the top.
- 1:07:28You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 1:07:33and the direct RSS feed at /rss on talkpython.fm.
- 1:07:37We're live streaming most of our recordings these days.
- 1:07:40If you want to be part of the show and have your comments featured on the air,
- 1:07:43be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:07:48This is your host, Michael Kennedy.
- 1:07:50Thanks so much for listening.
- 1:07:51I really appreciate it.
- 1:07:52Now get out there and write some Python code.