Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #286: Unreasonable f-strings

Return to episode page view on github
Recorded on Tuesday, May 31, 2022.

00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

00:05 This is episode 286, recorded May 31st, 2022.

00:10 I'm Michael Kennedy.

00:11 And I'm Brian Okken.

00:12 And this episode is brought to you by us.

00:15 If you're looking to learn Python, check out all the courses over at Talk Python Training.

00:18 If you want to get better with testing, check out Brian's pytest book, second edition.

00:24 Yes.

00:24 Yeah.

00:25 Yes, indeed.

00:26 Indeed.

00:26 All right.

00:27 Well, let's jump right into it, Brian.

00:29 Okay.

00:30 Tell me about the GIL.

00:31 I do want to talk about the gill, but I was just realizing that we're at 286.

00:35 I just started watching Big Bang Theory with my youngest kid.

00:38 And there's 279 episodes of them.

00:42 So we have more than it went on forever.

00:45 And we have more episodes than them.

00:46 That's quite the milestone.

00:48 I mean, you divide that by 52.

00:50 That's a lot of years.

00:51 We've been doing this for a while.

00:52 Yeah.

00:52 So Python and the GIL.

00:56 So the GIL is a thing, right?

00:57 It's like something everybody knows about.

00:59 I think people know about, but not too much.

01:02 So, I mean, you kind of, it means we can't do multiprocessing, but we can, but we can't.

01:07 So what is it?

01:09 And so I really like this article.

01:11 So this is an article called the Python GIL past, present, and future, because we have been talking about some of the no GIL options that are coming.

01:20 So this is really nice.

01:22 It's a, who is it?

01:23 Gary, Barry Warsaw and Pavel Polowicz, I think.

01:28 Anyway, really great article on the Backblaze blog.

01:33 And it starts out and goes through sort of what is the gill, why we have it.

01:39 It's a lot around the way in some of the history is around reference counting.

01:45 And maybe you knew that off the top of your head, but I forgot.

01:48 That reference counting is something, that's how we do memory management and all sorts of stuff within Python.

01:55 But to make it an easy implementation, there's this global interpreter lock.

02:00 And that just basically, instead of lock, like other code, you lock individual items, shared memory that you're using.

02:08 We just say the interpreter, let's just lock that and all of the variables that it uses.

02:13 It's not just reference counts, but other things too.

02:19 And this is just, it's a fairly quick read, but enough detail that you really kind of understand what's going on.

02:26 It does talk through, you know, reference counting, talks through that, some of the advantages, why it's really kind of handy to have it around.

02:36 But then attempts to remove it, including, like, I didn't know about this one.

02:41 There was a free threading one in 99.

02:44 From 1999.

02:45 Yeah, that's, I didn't know about that one.

02:48 It actually was successful.

02:49 It just made your Python code really slow.

02:52 So, not good.

02:54 And then Larry Hastings' galectomy, he's had a lot of PyCon talks, or a few PyCon talks around this.

03:00 So, that's an interesting thing to read about.

03:05 There's a little more, there's quite a few interesting bits in there.

03:10 But it never really got back into main Python.

03:14 But we're getting a little closer where, with this no-gil stuff.

03:19 So, there's no-gil stuff going on with Sam Gross.

03:23 From Sam Gross.

03:24 Yeah.

03:25 And then also, we've got Guido and others in Microsoft now working on this problem of speeding it up and everything.

03:37 So, really great discussion if you want to catch up on all the history of the GIL and where it's going.

03:44 And then a little prediction at the end of, we're going to see speed-ups.

03:49 Because of these efforts, we're going to see speed-ups in the next few years.

03:52 It's just going to get faster.

03:54 And then, if we get no-gil, it might be maybe five years from now.

03:59 Yeah.

04:01 Yeah.

04:01 It's pretty exciting.

04:02 There's some very neat work.

04:04 The stuff that Sam Gross is doing is quite interesting.

04:07 Yeah.

04:08 What's really cool is it's not just theory or people playing, right?

04:12 The Python 3.11 is a lot faster than the previous Pythons already.

04:16 And it doesn't even really touch the GIL side of things.

04:18 So, there's actual progress being made.

04:21 Yeah.

04:21 And it's actually, it's pretty exciting.

04:24 Pretty exciting time to be part of Python.

04:27 Like, it's never not been exciting, but, you know.

04:30 Yeah.

04:30 It only gets more exciting.

04:32 How's that?

04:32 Yeah.

04:32 So.

04:34 Hey, let me ask you a meta question.

04:36 So, this is on the Backblaze blog.

04:39 So, Backblaze.com is one of the, I think, better sort of backup my computer somewhere off-site

04:45 sort of things.

04:46 Yeah.

04:47 And the fact that they're blogging about the Python GIL is kind of interesting.

04:52 I wonder if they're a big Python shop and we just didn't know it.

04:54 Well, there's, like, I didn't know.

04:57 It's on their blog.

04:59 But, I mean, we've got Barry Warsaw in there.

05:02 It's written by Barry Warsaw and Powell.

05:04 Yeah.

05:04 So.

05:05 Are they, is he, he's, he says he's currently a senior engineer at LinkedIn.

05:10 So.

05:11 Yeah.

05:11 Yeah.

05:11 I'm not sure.

05:12 Sometimes life's confusing.

05:14 Yeah.

05:14 Not sure how this ended up there.

05:16 But, yeah.

05:17 No, but it's cool to see Backblaze supporting the Python world with some, some dives into the.

05:22 Yeah.

05:23 Maybe somebody from Backblaze can reach out to us and tell us what's going on.

05:26 Yeah.

05:26 That'd be great.

05:27 Also great.

05:28 Wouldn't it be cool, Brian, if we could take our Python program, whether this is a CLI or

05:35 some other app that we need to have for people to run.

05:39 And instead of saying, well, make sure you have this version of Python at least to make

05:42 sure you've set up a virtual environment, you've installed these things, and then you've got

05:45 this in the path, and then you've got this environment variable.

05:47 Now you can try to run our thing I gave you.

05:49 Yeah.

05:50 If you could just give them a single binary that contained all the Python, contained the

05:55 standard library, and you said you run this, and that's your app.

05:59 That's not bad, right?

06:00 Yeah.

06:01 So let me introduce you to PyOxy, the PyOxy Python runner.

06:05 Now, a while ago, we spoke about this thing called PyOxygen, no, PyOxidizer, that's what

06:14 it was, PyOxidizer.

06:15 And this is kind of like an advanced version of Py2.exe, or Py2.app, or PyInstaller.

06:23 But what's really nice is that it bundles the stuff up just sort of all into one thing, and

06:28 it runs out of memory instead of creating like a file structure of the files that you need,

06:34 and then, you know, sort of altering the path.

06:35 So like a copy of Python will run that, and so on.

06:38 So this PyOxy attempts to make the features of PyOxidizer more accessible and simpler for

06:45 people.

06:45 Okay.

06:46 So here's the deal.

06:47 It is an executable program for running Python interpreters.

06:51 So you can just give somebody this one PyOxy file, and they can, instead of saying Python

06:56 this, they can say PyOxy, some Python file, right?

06:59 You can say like run Python or run Python --and give it a file or something along

07:05 those lines, right?

07:06 And it's just a thing you copy around.

07:08 You don't have to worry about installing it or configuring your system or anything like

07:12 that.

07:13 So it's kind of a really easy way to pass around an executable that is Python and the standard

07:17 library without all the overhead or setup of actually installing a Python runtime.

07:23 Okay.

07:24 Wow.

07:24 Okay.

07:25 Yeah.

07:25 Yeah.

07:26 So let me go back up here.

07:27 That's pretty cool.

07:27 That's one.

07:28 It's a single file.

07:29 It's a single file that is a highly portable distribution of CPython.

07:34 So for example, on macOS and Linux, it statically links in a lot of the files that are dependencies

07:40 that you might find, you know, so if you try to run something in Python, it might go like,

07:44 oh, you have to install this other like C library in order for it to work correctly.

07:49 So all those things are also like its dependencies are statically compiled into it, which is pretty

07:54 cool.

07:54 Another thing that's interesting is it gives you a lot more control over the interpreter

07:58 and how it behaves.

08:00 Like you can pass it configuration files and do all sorts of crazy stuff to really tweak

08:04 the behavior of the runtime, the Python runtime that it comes with.

08:09 Yeah.

08:09 And it's just to sort of make PyOxidizer apps more accessible.

08:13 Okay.

08:14 So yeah, so it gives you, it's built with PyOxidizer and basically it gives you its own standalone

08:20 one.

08:20 Like I said, the, it has the whole interpreter.

08:23 It has the stuff statically linked.

08:25 It has the standard library.

08:27 And I think you can link your own libraries into it as well, which is pretty awesome.

08:31 And you could also give it, like I said, more control.

08:34 So you can create a configuration YAML file.

08:37 And when you run it, you can say, I want you to debug allocations, or I want you to, you

08:42 know, run, run this command to initialize the interpreter before it starts to run any code

08:47 and things like that.

08:48 So you can give it this YAML config file and so on.

08:52 So anyway, it's a pretty new project.

08:55 This is from Gregory Sork.

08:58 And he says, it's very young.

09:00 I hacked it together to try to get better exposure for PyOxidizer.

09:04 For people who want to build things that they can distribute more easily and so on.

09:07 And for me, he's talking about, oh, there's some certain circumstances where maybe you want

09:14 to have people run your script so you can send the script and then this thing and so on.

09:17 It's supposed to be sort of on par with zip app, which lets you ship the zipped up thing

09:24 of your app and then run it.

09:25 But the benefit is it already comes with Python.

09:28 Like a lot of these zip, shiv, pecs, et cetera.

09:31 They all require that Python is installed on the system.

09:34 And then you can run that, right?

09:36 With its dependencies.

09:37 But this is like, no, it even comes with Python.

09:39 So all that is pretty good.

09:40 What I would love to see out of this is, could I take this and build some sort of UI framework?

09:46 Here that, I don't know, maybe with PyScript and then get like a UI framework I can ship

09:52 to people and just go download this, double click it.

09:55 There's your app.

09:56 Who knows?

09:57 Yeah.

09:58 But anyway, if you're shipping Python to people, this might be worth checking out.

10:02 Yeah.

10:03 Yeah.

10:03 Neat.

10:04 Yeah.

10:05 Kim out in the audience asked, it looks very handy.

10:07 Does it make cross-platform executable?

10:11 I think you might have to run a build command or something or ship the right binary for each

10:16 platform.

10:16 But it does support macOS, Windows, and Linux.

10:19 So that's pretty cool.

10:20 Now, maybe you covered this and I just missed it.

10:24 What does it, does it deal with my dependencies?

10:27 Like if I have third-party dependencies?

10:28 That's what I'm not 100% sure how to do.

10:31 And I looked through it.

10:32 I was looking for that.

10:33 There's this oxidized importer.

10:35 Okay.

10:36 Which it talks about like this embeds a copy of the Python standard library and it imports

10:41 from memory using the oxidized importer.

10:43 I think that you could use that as well for your own dependencies.

10:47 And I'm pretty sure that's the goal of this pie oxidizer project in the first place.

10:51 So I would think so.

10:52 But nothing from this article was really clear.

10:55 Like, and here's how you bring in requests or HTTPX or whatever you're going to bring along,

11:00 you know?

11:00 Yeah.

11:00 Yeah.

11:01 Okay.

11:02 Or pie test.

11:03 I was actually just thinking if I, you know, run these tests.

11:08 Well, what version are you using?

11:11 Okay.

11:11 Just fine.

11:12 Here, just install this and run this test with this.

11:17 And that would be cool.

11:17 Yeah.

11:17 Exactly.

11:18 Yeah.

11:19 And Alvaro is, you know, when I was talking about UI stuff, he says, what about pie oxy

11:23 plus textual?

11:24 Yeah.

11:25 That'd be pretty neat as well.

11:26 Yeah.

11:27 Just around the corner.

11:28 Yeah.

11:28 Cool.

11:29 All right.

11:29 Well, that's pie oxy.

11:31 People can check it out.

11:32 All right.

11:33 Well, how about regular expressions?

11:39 Do you like those?

11:40 When they work, I love them.

11:44 When they don't, I'm like, what is this madness I've gotten myself into?

11:48 Okay.

11:48 So I was almost afraid to like talk about this, but it's a really awesome article because,

11:53 because sometimes you need regular expressions.

11:55 And, and one of the things there's lots of, I look that I like about this article.

12:00 What I'm talking about is an article called, the unreasonable effectiveness of f-strings

12:06 and verbose.

12:07 so, regular expressions and all languages, including, I think, and including Python have,

12:14 have a notion of, verbose mode.

12:18 And I've always been enticed by this.

12:20 The verbose mode idea is that you can like, instead of having this reared, you, you still

12:26 have the hard to read, regular expression stuff, but you can put comment, you can put spaces

12:32 and comments in it.

12:33 And, and then it can be multi-line, right?

12:36 What?

12:37 It can be multi-line.

12:38 Yeah.

12:38 It can be multi-line and you can have a bunch of, comments in there to say, oh, this

12:42 part of the regular expression, what it's doing is this, you know, and then, so it

12:48 makes it little, little snippets of regular expression are easier to read.

12:51 You're like, oh yeah, I can see that it's doing that.

12:53 Great.

12:54 When it's, when you clog it all together, which makes it really hard to read.

12:57 So, and then, and then of course you can build up strings in Python with f-strings

13:04 and do string replacement.

13:06 How awesome.

13:07 So that's what this article is about is really talking about, using, taking some

13:13 of the complicated bits of your regular expression or duplicated bits where you, it shows up several

13:19 times in your regular expression and pulling that out, that string out, and even maybe commenting

13:25 that.

13:25 And then, dropping it in with, f-strings to build up a complex regular expression.

13:32 It's, it's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:33 It's brilliant.

13:34 And it also is one of the best explanations I've ever read on, on, on, verbose, regular expressions.

13:39 So it's pretty cool.

13:40 Yeah.

13:40 I never really thought to refactor the pattern so that you have multiple strings.

13:45 Yeah.

13:46 Be like, here's the part that's repeated.

13:47 So we'll have a pattern that that's that thing.

13:49 And then F string it into the other pieces.

13:51 Yeah.

13:52 but it makes perfect sense.

13:53 Of course you should do it.

13:54 Yeah.

13:55 And now, I mean, I don't use it.

13:57 I mean, actually I kind of do, I use regular expressions on a regular basis.

14:02 but, the, but not like every day, but, but it's always something that I whenever I put it in there, I'm like, is anybody else going to be able to read this?

14:12 And so I put comments around it, but I've never, I haven't ever really embraced verbose

14:17 mode and I'm definitely going to use this now.

14:20 Yeah, for sure.

14:21 So the, the other thing real quick is you can have f-strings and you can have raw strings

14:26 and you can have raw f-strings apparently in Python.

14:29 So the prefix is F R triple quote, multi line.

14:33 Like that's, that's some serious string action happening right there, man.

14:36 Yeah.

14:37 raw f-strings.

14:38 Nice.

14:39 Yeah.

14:40 Yeah.

14:41 Yeah.

14:42 And, Neil out in the audience asks you, Brian, do you like your regular expressions?

14:45 Greedy or non greedy?

14:47 Okay.

14:48 I, I, it depends on what you're trying to do.

14:52 So.

14:53 Yeah.

14:54 I don't want mine to be greedy.

14:55 Let's share, share, share kindly.

14:57 All right.

14:58 Are we ready for the next one?

14:59 Yes.

15:00 Cool.

15:01 All right.

15:02 So this one I want to talk about, I'm going to start off from a weird place from a tweet

15:05 that I gave because I can't find anywhere else to talk about it.

15:09 Like this is why this needs talking about.

15:12 So I just want to sort of highlight some really cool stuff for people who are using PyCharm

15:17 and doing open source stuff that involves pull requests.

15:20 And these can be pull requests to your private repo.

15:22 Like one team member gave a PR back to the repo.

15:25 It doesn't have to be open, open source.

15:27 Okay.

15:28 So if you're using PyCharm, check this out.

15:31 Let me pull up this screen.

15:34 Come on.

15:35 Please.

15:36 Oh, I'm not logged in.

15:37 Oh, there we go.

15:38 I thought it might not.

15:39 Let me get the image up.

15:40 Anyway.

15:41 So check this out.

15:42 So people are probably familiar with the, the get support in PyCharm, you know, VS Code

15:45 PyCharm.

15:46 They all have really good get support.

15:47 You can see your changes.

15:49 A lot of times you have this, sort of over this gray little over overlay that says

15:54 who recently edited a file or a line.

15:57 It's really cool to go back with like get lens turned on for CPython.

16:01 Cause you'll see stuff from like 30 years ago.

16:03 Guido made this commit and here was the commit message.

16:06 You know, you're like, what?

16:07 This is crazy.

16:08 Right.

16:08 But working with PRs is one of the things that doesn't normally seem to fit.

16:13 And so I don't know when this got in there, but not too recently.

16:17 There's a, now a pull request tab.

16:19 So if you open a GitHub repository, if you're logged into GitHub and that GitHub repository has

16:25 a pull request and you open up the section, it gives you a list of all the open.

16:29 And I guess maybe you can toggle it close as well, but all the list of the open pull requests.

16:33 Hmm.

16:33 If you click on one of them, it'll show you all the details of the pull request.

16:37 The whole conversation.

16:39 If you click on that, who's the reviewer, you can change that.

16:42 Who's on a, who's it assigned to whether there's labels, whether it's been merged.

16:46 Wow.

16:47 Wow.

16:48 And then like on the right, you have this whole conversation.

16:50 You can see sort of the flow.

16:51 This person commented this and they made these few more changes.

16:54 Then they commented again here.

16:55 This is all really pretty neat.

16:57 But the thing that is noteworthy, the reason I brought this up is there's a button that says

17:02 check out.

17:03 So instead of trying to create a branch or fork their repo and check in, like you just, I

17:07 don't know where this repo or this PR came from or what branch it was against.

17:11 I just want to check it out and run it locally, run the test against it, see what it looks

17:15 like.

17:16 Yeah.

17:17 Go.

17:18 Isn't that awesome?

17:19 Yeah.

17:20 That is really, really awesome.

17:21 I like it.

17:22 Yeah.

17:23 Cause normally you're juggling a lot.

17:24 Maybe you have CI, continuous integration that tells you like the linting pass, but other

17:26 times you want to actually just get it and run it and play with it and decide, you know,

17:31 did this make the code slower?

17:32 Did it make it faster?

17:33 Do I like how like the result of this feature looks, you know, especially if it's like a UI thing

17:38 or something.

17:39 Right.

17:40 So I think this is, this is super cool.

17:42 And the reason I bring it up is there's like nowhere in the documentation.

17:45 Like if you go over to PyCharm here and you look for pull requests, there's, they don't

17:50 even mention this.

17:51 Right.

17:52 So I don't think people necessarily know about this.

17:53 Like, it seems.

17:54 It's a stealth feature.

17:55 It's a stealth feature.

17:56 It seems totally worth highlighting because dealing with PRs in that way is actually kind

18:01 of janky.

18:02 Right.

18:03 It's like, it takes a little bit of understanding, get maybe more than, and GitHub more than a lot

18:07 of people would off the bat.

18:08 So if you just go click, check out, play with it.

18:11 Nope.

18:12 I don't want it.

18:13 Or yes, I love it.

18:14 That's, I think that's great.

18:15 I would still actually manage the PR and GitHub, but the ability to explore it super quick and

18:19 easy within your project, I think is super cool.

18:21 Yeah.

18:22 And quickly grab the code because I've, I mean, I know in GitHub, you can get it.

18:27 You can clone their branch and.

18:29 Yeah, exactly.

18:30 But it's hard.

18:31 It's like not too easy.

18:32 It's a, it's several clicks at least to find it.

18:34 And so, yeah.

18:36 Right.

18:37 And do you actually want it cloned to your, your account?

18:40 Maybe not.

18:41 I want to check out the code, you know, like, so grab the right commit, hash, shot, whatever.

18:46 Yeah.

18:47 Also really quick while we're on this topic, I just want to give a quick shout out to this.

18:50 So if you go to just the jetbrains.com/pycharm right now across the top, there's this, oh,

18:54 here, there's this cool upcoming webinar.

18:57 10 things, 10 get things you wish you knew in PyCharm.

19:00 Very oddly that, that is me.

19:03 So anyway, if you want to, I'm going to do a webcast next week on June 7th.

19:08 Oh, nice.

19:09 About a whole bunch of get fun things in PyCharm and UI tools and whatnot.

19:12 So if you want to check that out, they definitely can.

19:15 Cool.

19:16 Yeah.

19:17 All right.

19:18 So that's it for my thing though.

19:19 Check out, if you're using PyCharm, use, check out this pull request thing.

19:21 It's even in the free version of PyCharm.

19:23 So it's, it's worth noting.

19:24 Nice.

19:25 Huh.

19:26 Let's see a really, really quick real time follow up.

19:30 Roman Wright.

19:31 Hey Roman.

19:32 Says, yes, it helps you sort out PRs so much.

19:34 I totally agree.

19:35 And then Wolf says, is it available in IntelliJ and does it work with GitLab?

19:39 I don't know if it works with GitLab.

19:41 I'm quite sure it's available IntelliJ in IntelliJ because like PyCharm is just

19:46 basically specialized IntelliJ.

19:48 So I'd, I'd be very surprised if it weren't available in IntelliJ, but I can't say for sure

19:53 in GitLab.

19:54 I don't know if it's a documentation, but I also can't find that.

19:55 So anyway.

19:56 So on the PyCharm side, there's, isn't there supposed to like a new, some UI changes that

20:01 happened recently or, you know?

20:03 Anyway.

20:04 Possibly.

20:05 Oh, one of the things that changed recently that was, I actually kept stumbling into it

20:11 like on the Git stuff is they have little overlays of who made changes when kind of like that

20:14 Git lens from VS Code I described.

20:16 Yeah.

20:17 They started adding that and I kept clicking it by accident, trying to click on the line.

20:20 So that's like, why does it keep popping up a diff?

20:22 Oh, I see.

20:23 Okay.

20:24 So I kind of crashed into it, but yeah.

20:26 Okay.

20:27 Anyway, if you're doing PRs, check this out.

20:28 If you're doing PRs and using PyCharm, check this out.

20:30 It's definitely useful.

20:31 All right.

20:32 Well, so we have no guests.

20:34 So that's our items for today, right?

20:36 It is.

20:37 It is.

20:38 Well, we would be remiss to not have extras though.

20:41 Of course.

20:42 So yeah.

20:43 You want to do the extras first?

20:45 Your extras first?

20:46 Sure.

20:47 I just got one.

20:48 So the, it was a couple of weeks ago.

20:52 We, I think we talked about, about Pandas Tutor switching to Piedide, I think.

21:01 Yep.

21:02 So there's a, there's an article that came out on the Piedide blog that is a panda about

21:08 pandas tutors switching to, or Piedide, Piedide, Piedide.

21:13 and so, one of the, the reason why I bring it up is because there's some cool stuff

21:19 in here.

21:20 It's a, it's not just, Hey, we did this, but it's also, why did we do it?

21:24 And kind of walking through some of the stuff, how they did a self self-contained pandas tutor

21:29 wheel, you know, dealing with JavaScript and imports and all that sort of stuff.

21:35 And the fine tuning and what work has to go further.

21:38 So other people that are like, Hey, this Piedide actually proof of concept.

21:43 It's starting to look cool.

21:44 I want to do this too.

21:45 This might be a nice thing for people to check out.

21:47 So, yeah, this is super nice.

21:49 And I, I definitely think the, what are the rough edges and what worked really well?

21:54 Those types of lessons for now are going to be really valuable for people trying to adopt

21:58 this.

21:59 Yeah.

21:59 Well, that's all my extras.

22:00 Awesome.

22:01 All right.

22:02 Well, let's just make it a straight run for Piedide and Piescript right out.

22:07 So last week I did two videos on Piescript, which is based on Piedide as well.

22:16 So first one is a 30 minutes video.

22:19 I sort of hinted that I was working on this, but remember I said it wasn't quite released

22:23 yet, Brian.

22:23 Yeah.

22:24 Last episode.

22:25 So now it's out.

22:26 So now you can check out, I'll link to it.

22:27 You can check out my 30 minute Python, Piescript, WebAssembly, Python web apps running locally,

22:32 which is super fun.

22:34 It's all about not just, you know, let's like take some Python and put it in the browser,

22:38 but how can you use some like Piedash config settings to override where Piescript actually

22:44 comes from.

22:45 So the Piedide, the runtime comes from, so you can like put that locally in your app and then

22:49 download it offline and all sorts of fun stuff there.

22:52 Cool.

22:53 So basically building an offline progressive web app that is like, can be almost a hundred percent

22:57 offline.

22:58 This one calls an API, so it still needs this API.

23:01 Anyway, that was really fun.

23:02 And then the next day after releasing that, it occurred to me, do you know what supports

23:06 progressive web apps?

23:07 iOS and Android.

23:09 So I created a second video called Python iOS web apps with Piescript and offline PWAs.

23:15 And so here is, if you're looking at the screen, there's a, on my iPad, there is a web app that

23:23 runs Piescript talking to a Flask based API over the internet.

23:29 And it is basically, you can go up and basically say, install this as an app on my iPad.

23:34 And when you launch it, that install process already down downloads the WebAssembly and the

23:39 run the standard library and all the WebAssembly stuff that makes it large.

23:43 So you just boom.

23:44 And it opens up within like less than two seconds running Python client side on iOS.

23:49 That is so cool.

23:50 I'm seeing lots of uses for this.

23:52 I mean, people could do like dashboards of pipelines and all sorts of stuff and have them be on tablets

23:58 now.

23:59 So yeah, absolutely.

24:00 Yeah.

24:01 It's, it's, I mean, once you've already made it a progressive web app, it's like a few button clicks,

24:05 like this whole video about this iOS thing with like setting the stage and everything is, it's three minutes.

24:10 So, I mean, it's not a hard process to make it happen, but it's just not obvious.

24:15 And it's really cool that it works that way.

24:16 Cool.

24:16 Yeah.

24:17 All right.

24:18 Well, that's it for my items.

24:20 I do have a joke.

24:21 Nice.

24:22 Nice.

24:23 And I know you might have a joke as well.

24:25 Yeah.

24:25 Awesome.

24:26 Okay.

24:27 I'll go with mine first.

24:28 Cause mine's easy.

24:29 And then I have a bonus joke for you based on your topic that I didn't, didn't see coming.

24:32 Okay.

24:33 So this one comes from Brian skin.

24:35 Thanks, Brian.

24:36 I just sort of pointed out a joke from Seth and it says people are out here just dangerously

24:41 thrown around SQL abstraction layers.

24:43 And if we aren't careful, someone's going to lose an arm and O R M.

24:48 It's pretty good.

24:49 Yeah.

24:50 It's really good.

24:51 Yeah.

24:51 Yeah.

24:52 Actually, if you are careful, you can lose your arm for good.

24:55 Yes.

24:56 And still be, still be all right.

24:58 Yeah.

24:59 All right.

25:00 So here, here's the, here's the real time joke, a followup that, based on your, your,

25:04 okay.

25:05 Regex one.

25:06 Ask me why I'm looking like this.

25:07 Why?

25:08 Well, that's just my regular expression.

25:11 It's terrible.

25:12 It's really bad.

25:14 All right.

25:15 I wish I had somebody in my life.

25:16 I could share that with other than you.

25:18 Okay.

25:19 Okay.

25:20 If other people listen to the show, we could share it.

25:21 Okay.

25:22 So, the, there's like all sorts of AI and stuff going into, code editors.

25:28 Now that make them like do all sorts of stuff to help you out.

25:31 Right.

25:32 So, Kermit the frog looking out of, out of rainy window.

25:39 It's when you've barely started writing a line of code and your ID already lets you know about

25:44 three syntax errors, two runtime errors, a grammar mistake, five misdemeanors, contempt of court

25:49 and treason.

25:50 Joe's getting started.

25:54 Why is it so hard?

25:55 I love it.

25:56 That's really good.

25:57 Anyway.

25:58 Yeah.

25:59 I kind of felt that way today.

26:00 I was, I was playing around with some stuff.

26:01 I'm just like, what is good.

26:02 This is over the top.

26:03 This thing.

26:04 Yeah.

26:05 So, but no, good.

26:06 I'm glad the editors can help us out, but sometimes I feel like an idiot.

26:10 So yes.

26:11 Anyway, indeed.

26:12 Well, great being here with you.

26:14 Good being here with you.

26:15 Indeed.

26:16 Thanks everybody for coming.

26:17 Bye everyone.

26:18 Thanks for being here.

26:19 Bye.

26:20 See you next time.

Back to show page