Python Bytes - #280 Easy terminal scripts by sourcing your Py

Episode Date: April 21, 2022

Topics covered in this episode: BTW, don’t make a public repo private The counter-intuitive rise of Python in scientific computing Dashboards in Python sourcepy Xonsh Extras Joke See the full ...show notes for this episode on the website at pythonbytes.fm/280

Transcript
Discussion (0)
Starting point is 00:00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds. This is episode 280, recorded April 19th, 2022. I'm Michael Kennedy. And I'm Brian Ocken. And I'm Pat Decker. Welcome, Pat. Great to have you here. Well, thanks for having me on. Yeah, it's really exciting.
Starting point is 00:00:18 You and I were chatting a bit about less new programming languages a bit over email. And yeah, it'd be fun to just have you come on and share some of the things that you're passionate about and whatnot. Tell people a bit about yourself. I got started with computers way back in the day. High school, I had an Apple II computer at school. Eventually got a Commodore 64 at home. I did Pascal on cards at Iowa State University and then did a data processing
Starting point is 00:00:48 program at Kirkwood in Cedar Rapids and got my first job out of there about 30 years ago or so. So I've worked mainframe and PC, COBOL, C, and a little bit of Python here and there. Fantastic. And it sounds like you're doing DevOps type things today. Yeah, the company is, like many, gone from on-site in their own data center to 80% or so running on AWS. And so I get to share your same frustration
Starting point is 00:01:21 with the AWS interface in Python. It's not always obvious how that works. It's updated every week. And I know the way it is updated every week has got to be some code gen is running somewhere that regenerates it. And it's just never quite discoverable, right? It's fine once you get it working, as long as you don't touch it or have to understand it. This is not the sign of a fantastic API, but it's cool. You get to work in AWS.
Starting point is 00:01:48 Cool. Well, great to have you here. Now, Brian, before we jump over to your first topic, I just want to say this episode is brought to you by Mergify. I am psyched about what these guys are offering. Mergify is super cool. It's all about automating Git collaboration. And I have a lot to say about Git, but I want to start with Pi because I love Pi.
Starting point is 00:02:09 Banana cream pie is my favorite. I'll take a cheesecake. Does that count as a pie? Is that what we're talking about? No, we're talking about HTT, HTT Pie. And the... Still a good pie. Yeah.
Starting point is 00:02:20 The website actually lists in their readmeme tells you exactly how they wish you to pronounce it right off the bat h nice tt pi um anyway it's a command it's a really cool tool it's a command line uh tool and i think we've covered it before um for uh for interacting with uh it's especially useful for apis so you don't we do one of the first things i install on any server on my mac if i get a new one. This thing is fantastic. Yeah, yeah. And it's so fantastic that it had 60. This is what I want to cover.
Starting point is 00:02:50 I'm sorry to laugh. It had 54,000 stars on GitHub, and then it lost them. Then it didn't? Then it didn't. So what a cliff. So how many does it have now? Right now, if we look, it's got 16.1,000. Oh my gosh, it's way back.
Starting point is 00:03:08 Yeah. Actually, this morning when I looked, it was just 16.0,000. So it's gotten 100 stars just as I was researching this. So anyway, I guess what I want to shout out to these guys. It's a cool tool uh if you're doing apis check it out and also if you've started before restart it because they they deserve it and what happened was they accidentally put their uh repo private for there were somebody
Starting point is 00:03:38 was trying to do uh make it private make something some other test repo private and uh they accidentally put the main one private and if you're even private for a second you lose all your stars um so warning don't make your public don't do that oops wow that is um yeah it's a good warning it's a great tool but a good warning it does have a danger zone danger zone this is going to happen but unfortunately the warning is equivalent if there's zero followers and zero people interested in or you have one of the most popular things on github like it should be like this is super duper important you're going to lose 54 000 github stars are you doing it yeah well and also i mean if if you work with a lot of uh github repos and you're like like maybe you made something public for a talk and then you're making it private because i don't know
Starting point is 00:04:32 the talk's over or whatever or you just don't want to maintain something like i'm just done with this thing if you're working with it a lot maybe you've seen that warning so many times that you're not really reading it anymore and double checking. So I guess this is just a warning. Double check it. If you can see that warning box, make sure you're on the right repo. Indeed. Pat, what do you think about this? Yeah, it's pretty tragic.
Starting point is 00:04:54 It's kind of like those end user license agreements where we all see them so often. They just automatically click, I think. Yeah, exactly. The confirmation dialogues and stuff. You're like, well, i have to copy this and paste that there i just can't continue so i'm going to just you know instead of warning danger people i think people see i want to get my work done so click here to get my work done and then oh no what happened yeah yeah yeah well brian i believe you have uh at least helped a little bit
Starting point is 00:05:21 david out in the audience says starting it right now. Oh, I forgot to start also. I'm going to go start. You better get in there and start. Boom. All right. Plus two. Good need. I was going to start myself, but I'm not logged in in any of my browsers
Starting point is 00:05:31 for some reason on this account. So no starting. I have to start it later. OK. Also, a little bit out of order, but I want to also just cover this other thing. We are generally
Starting point is 00:05:41 not 100% of the time because there's still a little bit of long tail stuff happening. But generally, not 100% of the time, because there's still a little bit of long tail stuff happening, but generally we are moving our live stream of the recording, the one where David said, I'm starting right now. Thanks for being here, David. That recording is now moving to Tuesdays at noon Pacific time. So if people want to come be part of the live show,
Starting point is 00:06:00 see the video version, as well as just make comments or whatever, not Wednesday, Tuesdays in general, but check for the next week couple weeks because it is still like some pre-scheduled stuff yeah so how do people find out when it's coming up next i would say the the best way is just to subscribe to the youtube channel and then you know okay i hate to say it but push the little bell for notification so it'll tell you like hey this thing's coming up uh and it'll let you know that we're gone live yep yep i don't have a great better way uh maybe we could do a mailing list but it's it's a little a little tricky but usually stick around on tuesday pacific uh tuesday noon pacific we'll be recording yeah yeah if you check youtube once a week you'll see it's scheduled pretty far out and then you can get a reminder for just that one
Starting point is 00:06:42 thing you don't have to always get messages okay so So this is a fun one. You mentioned some of the older programming languages. When I was in college, I was studying chemical chemistry, chemical engineering, math, all these different things. And as part of that, they said, you're going to have to take a programming class. I'm like, super, what's it going to be like C++ or something? Remember, this is like early 90s. So that was a good choice then. And they said, no, you're going to take the most important programming class you're ever going to take in your career. You're going to learn Fortran. I'm like, wait a minute. No, no, no, I don't want to do that. That doesn't sound like the most important thing ever. But nonetheless, that was one of my
Starting point is 00:07:21 first courses I had to take. I only took a couple. I eventually got to take some C++, but Fortran was where it started. So here is an article that was recommended to us by, let me make sure I get the name right, Galin Swint. And Galin is a PhD researcher and said, hey, here's a really interesting article. The article I don't believe is by them, but it's about the sort of, I think it was something in their lab they were talking about. It says the title is The Counterintuitive Rise of Python and Scientific Computing. Why is it counterintuitive? Because Fortran is fast. And what you want to do is process lots of data and you want to do it fast. So here's a really interesting story of people who
Starting point is 00:08:02 were doing older stuff like Fortran and C sort of were forced in, coerced into doing a little bit of Python and accidentally made their supercomputer stuff go like a hundred times faster or something in Python rather than in C or rather than Fortran, which is a counterintuitive result, right? Yeah. So I think that I'll cover a few details of this article, just pull out some highlights. But the reason I'm bringing an article instead of like a tool or something is I think this would be interesting for people to share if they're in a situation where they're like, oh, Python is no good. This is such a slow language. It's like doing math is like a thousand times slower than C. I don't actually know what it is, but it's a lot slower,
Starting point is 00:08:41 right? So it goes through here and here's a couple of things. It says, in our laboratory, a polarizing debate has been raging since 2010. Summarized by the question, why are more and more time-critical scientific computations formerly performed in Fortran now written in Python, a slower language? Oh, Python, a slower language. So Python does have the reputation of being slow and especially around math. I think it's honestly, it's earned it. Unfortunately, I would really love, sidebar, I would really love to see Python adopt something along the lines of value types that can be boxed back to PyLongs, right? So like on the stack locally, it's a number, but it gets complicated. But I think that would actually solve a ton of stuff. Anyway, so yeah, plain Python is slower than Fortran.
Starting point is 00:09:28 But when you do computational stuff, you don't do plain Python. What you do is you do numpy, scipy, dask. All of these things are written in C with a thin coordination layer in Python as part of its API, right? So here's like some graph you can see on the article and it says here's like 10 to the 1 versus 10 to the minus 2.
Starting point is 00:09:51 So it's at 100 times faster if you use Cython or Numba or NumPy and so on. So pretty interesting. And it also shows, guess what? Shocker! New alert! Fortran is somewhat less popular than it used to be. Oh no.
Starting point is 00:10:09 So there's an interesting story of this project nicknamed Projector written around 2010. So modern in quotes Fortran by somebody named Bob bob so bob worked on this project and there's apparently let me find the numbers here it's like a 1.5 000 lines of fortran code so a lot of fortran code like a lot of complicated math bits the kind you kind of don't want to touch after it works and it's going to do um it's trying to project something, thousands of multiple multi-perforations of combustion liner onto a 3D complex shape made of millions of polygons. So that might get complicated when you multiply those numbers together. And it turns out Bob soon discovered that he was going to use NumPy and this thing called a KD tree. Because there's a bunch of people working live that only knew Python.
Starting point is 00:11:07 So like, here's a Python version you can use. And he thought, this is going to be rough. It's going to be super slow. So he went and ran it after he got it done. And the Fortran version ran in six hours and 30 minutes. The Python version, four minutes. Wow. So what happened?
Starting point is 00:11:26 Is Python 100 times faster? No. Python is easier to work with and has many more built-in algorithms and data structures. This KD tree thing was using a different data structure, is a different data structure that has O log N complexity, whereas the Fortran version, because it's so hard to write code in, they just wrote it in the simplest way they can make it work. So O N, and when you have billions times millions times thousands, O log N wins, even if it's in a slower language. So if the conclusion was Fortran would have been faster if they had implemented this KD tree algorithm in it, but the people working on the, they're like computational scientists,
Starting point is 00:12:07 not PhD data structure type people, right? Like they're already super busy just trying to do the programming and not working on like cutting edge data structures and optimizations and stuff. So it was very easy to try one new thing in Python, which would have been very hard in Fortran and we got this big win.
Starting point is 00:12:25 So anyway, I think the debate about performance developer speed versus execution speed, but also straight up execution speed, I think it's really interesting in Python and it's hard to be nuanced enough. It's always there's some little interesting wrinkle like this. Yeah. And if you're really, you're going to hand code everything anyway, it's also faster in assembly. So just write assembly. There's a downside to that. I've always wanted to stick to this one processor I really loved forever. But this is interesting. I like it. But it sort of reads like a commercial. So Bob was programming scientific computing and he was not happy in Fortran.
Starting point is 00:13:08 Bob tried Python and now he's happy. Well, I think Bob unwillingly tried Python and eventually he was happy. Like it sounded like he didn't want it. He was dragged through it. I like it. Yeah, yeah. I know it does read a bit like that, but I think it's an interesting story. Pat, what do you think?
Starting point is 00:13:23 You've had, you have a bit of a historical perspective on all this. Yeah. I didn't, didn't go to school for chemistry, but I bet Fortran's not popular among chemistry students, is it? No, not anymore. Sure. I did a little benchmark the other day. I was trying to just see how, uh, how fast some EFS storage was on AWS versus EBS.
Starting point is 00:13:44 And so I wrote a Python script to do that and wrote 10 million records out. And I thought, well, maybe Python is going to be slow. So I thought I'll just whip up a quick thing in Rust here. And as it turned out, Python was 10 times faster at that too on the same exact hardware. And I'm not sure why that was.
Starting point is 00:14:02 I mean, I would have done something that was optimal for Rust, but there it is 10 times faster. No, that's, that's super interesting. I've seen Python just rip across like OS type stuff like that. It's pretty good. All right. Well, what's your first item, Pat, are we off to the metaverse or is the metaverse off to us? I stumbled across this the other day. We we've, uh, you've had Lucas Longa on the show, the, the programmer in residence, and it looks like they're going to get another year due to a donation from Meta of $300,000
Starting point is 00:14:34 to the Python Software Foundation. And it was specifically for that purpose. That's a really big deal. And like you said in the past too, Python is very important to Meta, Facebook's parent company now, because much of their infrastructure is built on it. PyTorch in particular, they use it a lot. So their internal implementation of Python is called Cinder, apparently, which I think I've seen mentioned a few times. But they would like to see continued development, and they're going to fund it, which is awesome. Yeah, that's really neat.
Starting point is 00:15:10 I think Cinder is a fantastic thing they've created. And it's interesting. It's open source in the sense of, like, maybe the better term would be source open. Like, here, we're going to put this out here. We don't expect any contributions, and we don't want to put it out there out there as like a project to grow on its own, but we think it might inspire people. So here's the source. But what they have contained in there is amazing. There's just so many optimizations and different things. I think they might even have that value type thing I discussed in there. I can't remember, but yeah, that's a really cool project that they're working on.
Starting point is 00:15:46 So this is great. You know, I think Lucas Schlinger has gone sort of full circle, right? He was independent that he was at Instagram for a while, which is, you know, part of meta.
Starting point is 00:15:55 I then left to sort of do his own thing and found his way to this developer in residence. And now meta is sending money so that he stays there. That's like a interesting circle, I think. Yeah, that's good. That's like an interesting circle, I think. Yeah, that's good. It seems tenuous, though, that we have it at like one year at a time,
Starting point is 00:16:11 that we don't know if we're going to have a developer in residence longer than another year. It's like a postdoc. Hopefully it's a game of tag with Microsoft coming next or something. Yeah, exactly. That'd be great.
Starting point is 00:16:23 And I think there are a couple of organizations doing that. So I know that there was a talk about having multiple folks sort of participating in that group, which would be great
Starting point is 00:16:32 because I know there's way more work than Lukasz can do on himself. He's quite busy. Alvaro in the audience has a fine name proposal here. The PSF developer
Starting point is 00:16:42 in residence should be called the PSF Dunderder. Underscore, underscore, D-I-R, underscore, underscore. I hereby am opening a pep. Well done. No, just kidding. I want to give him more work for something silly like that, but that's pretty awesome. The PSF Dunderder. Cool. Well, thank you, Pat. Now, before we move on to the next item, let me tell you all about our sponsor today. And like I said, I'm really excited about this. I'm actually doing a bunch of work
Starting point is 00:17:10 on some Git presentations. And so I'm just trying to think about what's the workflow with Git and how can we work better, especially doing team type stuff. So Mergeify is a service that will help you and especially your team be way better with Git. So it's an amazing tool to make you and your team be more productive with GitHub in particular.
Starting point is 00:17:33 It's all about leveling up full requests. So some of the features of their platform that you hook into your repositories are automatic merges. So you can set up conditions for an automatic merge and Mergeify will take care of merging the PR as soon as it's ready and passes all the details. There's automatic updates. So if you have multiple pull requests, it'll merge the pull requests serially on top of each other. So there's no way to introduce a regression.
Starting point is 00:17:59 There's also merge queues. So if you've got like a long CI process and things are slow or you've got lots of code, you can set up priorities and have the most important ones merge fix like bug requests or bug fixes, especially if they're security fixes, they go right here, right at the front, do those now. So that's awesome. They also have something called backports. So Mergeify will copy the pull request to other branches once it's merged, if you set that up, so that you can ship bug fixes to multiple branches,
Starting point is 00:18:29 feature branches and whatnot automatically, or even older versions, right? Version 1.0 of your app versus 2.0, 2.2, whatever. Have those automatically merge those bug requests, bug fixes in. Super cool. So Mergify does all these things automatically that you would otherwise
Starting point is 00:18:45 have to do manually. So you save time. You and your team will focus on projects that matter the most. Mergify is coordinated with any CI and is fully integrated into GitHub. They also have a startup program that can give your company up to $21,000 of credits. So if you're doing a startup and you want to use them to help grow, you and reach out to them for sure, do that by going to pythonbytes.fm slash Mergify, sign up for a demo and get started. The link is at the top of your podcast player show notes. So just click it. Thanks to Mergify for supporting our show. Very cool project. Yeah. All right, Brian, what's the next one here? Well, we were talking about data science a little bit and people using Python for data science. But one of the things that people use when they're doing data science, plus other stuff and DevOps and whatever, is dashboards.
Starting point is 00:19:32 Dashboards in Python is one of the powerful reasons to use it. And so there's a couple things I want to discuss around dashboards. Both of them come via suggestions from Mark Scoove madsen so thanks mark uh first is the easiest way to create interactive dashboard in python obviously it's their opinion but it does look pretty easy is uh to use hvplot.interactive so uh this is an article that talks about how to do this and um and it really looks nice this uh this this panel looks pretty good oh yeah that's great pulling data out you got dark and light and you've got the the um controls on the inside sliders yeah okay um so this is a this is just using some some
Starting point is 00:20:18 pre-canned data but you can use obviously your own data but the the uh article is pretty short and one of the things i love about it of course is it's got a animated gif to show you exactly what you're getting into um and then also um a video so uh the one of the authors um sophia just reads the like pretty much goes through the article and talks about it and shows the demo of everything um so that's nice and it's only like six minutes i was watching it this morning so uh really cool if you want to try and so hv plot is part of the holo viz uh family of tools um so a lot of people are already using that or if you're not check that out cool stuff yeah this looks great the other i always want to have good uh use cases for this and i just i don't find myself doing lots of dashboards and stuff but every time i see them like wow what can i build a dashboard for that would be great to have good use cases for this. And I just, I don't find myself doing lots of dashboards and stuff. But every time I see them, I'm like, well, what can I build a dashboard for?
Starting point is 00:21:08 That would be great to have this. Well, so I have some use cases for dashboards, but I don't really don't want to spend a lot of time on it. And I think even though this is like six minute video of how to get through it, I think that probably I'd have to set aside maybe a half day to figure out something to get it usable. But it does show that once you understand what you're doing you can do you can throw together dashboards pretty quickly and uh and be able to well one of the we didn't in the demo one of the dashboard items was and the controls is like let's say you've got a whole bunch of columns or uh or some different
Starting point is 00:21:42 elements in in a call in a row that you are in a column that you want to filter out. So there's ways to filter your data so that you're looking at different stuff. And I was like, I have an exact use case for this. So I'm pretty excited. The other thing around plots is maybe HV plot or dashboards is maybe HV plot isn't the right thing for you. Well, we've got another thing is the pie data global 2021. There's a video stream up on YouTube called the Python dashboarding
Starting point is 00:22:13 shootout and showdown. And so this is a different, a whole bunch of different presenters talking about building dashboards and Python using either dash or panel or voila or streamlet. So watch different people do it. So if you want to watch some, use something other than H3 plot, watch this video. One of the things I love about this is if you're only looking forward to one of them, one of the commenters on this video put up hyperlinks to each of the different sections. So you can just hop right to the video part
Starting point is 00:22:49 that you want to watch. Oh, yeah, that's great. Yeah, looks good. I love these dashboards. It's definitely one of their powers. Pat, do you do anything with them? Sorry, Brian, I got you out of your way. We do have some pre-built dashboards
Starting point is 00:23:01 to monitor the EKS cluster in Grafana and Elastic. But this is another option. It'd be good to do something ad hoc. If it's a quick and dirty, maybe I could whip one out. So Brian, do you just like grab a Pandas data frame and then make it interactive? No. Not quite, but
Starting point is 00:23:20 it's almost. I mean, this is built to go really closely with Pand's data frames. So the code is, you know, you're doing some filtering, some pipeline processing, like group buys and selecting what index you're going to use. And then, yeah, it's pretty much interactive at that point. But the code around this is building the widgets for the the controls you got to define the ui and how people interact with it got it yeah it's not it's but it's pretty easy uh i can't imagine i mean it's not obvious because so you have to kind of it's good to watch
Starting point is 00:23:56 a tutorial or something but um it's also not difficult uh and then and putting it together yeah so most of the code coding here is not the interactive plot because that's kind of already happens, but it's the widgets. Got it, cool, thanks. All right, I think you all will be excited about this. I think this is quite a neat project. Now let's see, this was sent over by Dave Chavelle,
Starting point is 00:24:20 or actually is both sent over and is by Dave Chavelle. So I don't know, Brian, do you ever use entry points in Python packages? You know, so you can set up and pip install a package. And then if you have that Python active, then you can just type a CLI command that is one of the entry points there. You know what I'm talking about?
Starting point is 00:24:37 Yeah, I do that all the time. That's great. But there is some overhead to set it up, right? I've got to install it as a package and whatnot. This project called sourcepy allows you to basically turn any function into a CLI command, straight CLI command in one line. So let me show you, talk about, and it doesn't involve packages and installing or anything like that. So imagine you've got some file here and it's got a function, just a def function. PyGrep is the example here. And
Starting point is 00:25:05 it has a pattern, which is actually a regular expression pattern. Note the typing. It has grep data, which is a list of text inputs. So it could be a string or something, but it could also be like something piped or standard in or something along those lines, right? So if I have this script that just does that work with those that type assigned data, and I have high source source pi installed, I can say source this file here. And what it will do is it'll actually add up the it'll expose those functions like pi grep and so on. So then I can just type by grep and it'll tell me how it works. And somewhere in here, where's the example running it? Oh, right here, I think it is.
Starting point is 00:25:49 So what you can do is you can just run pygrep against, now, as a function, right? As a CLI function. So it has all sorts of cool features. For example, it has this type handling. So type hints that we talked about can be used to coerce inputs off the command line into integers and patterns and i o streams for like files and standard in and such uh let's see it just takes basically any
Starting point is 00:26:12 function like this and turns it into something you run on the shell and then you can also go down and um you can do like i believe there's some sort of class-based way to work with it and so on but yeah this is pretty neat. What do you think? I guess I'm confused at how it works with the normal source command. That is a good question. How does it not break normal source? Yeah.
Starting point is 00:26:34 That's a good question. Yeah. It is a good question. Does it replace it for a while you've got it installed, or does it extend it somehow? Yeah, I don't know i haven't looked at it enough to understand how it either coordinates or overrides sorry sorry to put you on the spot there no no it's a great question um yeah i haven't played with it but it's it's
Starting point is 00:26:57 really important you would want to know because you want to break your your regular source step i'm sure you could alias it if for some reason it conflicted but i don't know i think uh so i think this would be really helpful for uh aside from that if if that's all working great then um aside from that i think it's a very useful way to have like a handful of little tools for um for a project to be able to use that um if you're trying to share it with other people i kind of think packaging it the right way to have entry points is probably the right way to go yeah if you yeah you want to do a more formal like a pip x style but this feels way more ad hoc right like pat was talking about his little script that he built to test some stuff he'd run this and then just call those functions as if they were built into bash or z shell or whatever definitely also also worth pointing out it has built-in native
Starting point is 00:27:43 async support so if you have async functions and you source it then you can just call call it as if it was a regular command line command and it's it still just takes it and runs and kim ben wick who's been a co-host here before has a clever thought i suspect it wraps the normal source command and hands it over to the normal source if it is in Python. Seems like a good idea. Probably. Yeah, probably. Although, like I said, I haven't really looked at the mechanism there. But this looks like a cool project. It's got all sorts of supported types like JSON and unions and date time objects and all kinds of stuff. So check it out if you do a bunch of kind of ad hoc stuff with Python on the command prompt.
Starting point is 00:28:26 Pat, how does this strike you? I know that this might touch some of the things you're doing in your world. Right, yeah. Just yesterday, one of the guys was contacting me because he needed to go and cycle through a list of addresses to hit an API. And this could be something you'd use like that. Consume this file and hit the API with each example and away we go. Yeah, absolutely. Yeah, this looks great for putting a little,
Starting point is 00:28:50 making those little scripts you build with Python, like literally scripts. I know a lot of people call everything Python scripts, but this is really for those types of apps. A single file script. Yeah, yeah. A single file thing, not like a 20,000 line flask app, right?
Starting point is 00:29:04 That I think starts to stretch the terms of what script might mean. But this is exactly for those things. Yeah. All right. What's your final one, Pat? This is similar to what you just covered, actually. You've talked, I think, a little bit about it before. Conch shell combines the best of Baz shell and Python in the Linux terminal.
Starting point is 00:29:23 I ran across this one. This is way more than what I covered. This is like another level here. It takes it to another level, yeah. I ran across it on itsfoss, which is a nice site for open source type things. In a nutshell, what it does is provide you with a new shell where, as they demonstrate here, you can use straight Python.
Starting point is 00:29:44 You can import json for example and and define a a variable or a table uh print print that out and uh format it uh the length function here but you can also then mix in regular bash functions where we for example here it curls from a website the result comes back and the length function tells you the length of that curl oh how interesting and one of their that's a little bit like um almost like a ginger django template but in your terminal right you put a little dollar to say here's a a bit of code to run on the shell. Yep. Shell to run here. The one famous statement they have is,
Starting point is 00:30:30 I always forget how to do a for loop in Bash, but in Python, it's pretty easy. And they have kind of a rule. It evaluates to Python first. If it evaluates to Python, it executes as Python. If it doesn't, then it more or less executes as Bash. And I do have a link we could put in the show notes too, to a video demonstration from their homepage. And the guy does a spectacular demonstration with autocompletes and they have what they call contributions. And that also begins with an X.
Starting point is 00:31:05 So it's like a plugin or an add-on, but it's a contribution. And it is get-aware and it is virtual environment-aware. It sounds like a killer environment, but it would take some getting used to. I have a lot of muscle memory to overcome to take full advantage of. of muscle memory to overcome,
Starting point is 00:31:26 to take full advantage of. This is cool. Brian, have you played with this? You know, I tried to play with it a couple of years ago, but now I haven't, but I do want to. And I think one of the things, I didn't give it a fair shake. And I think it would be good to just say for a week,
Starting point is 00:31:43 maybe I'm going to try to just use this instead of pulling up my normal terminal just to see if i can get used to it that's the thing i think you have to immerse yourself probably and and it is about five years old i think it's fairly mature yeah and yet also the less i write bash scripts the more i wish that i bash scripts were more like python scripts so now they are now they are yeah this is great uh a good find and it's something i've also wanted to play with but haven't nice brian you got any extras you want to share with people i don't this week how about i thought i didn't but then i did i just want to do a quick follow-up okay um i was just thinking about a couple episodes ago where we talked about the march madness package tournament that that Chris May had sent in.
Starting point is 00:32:28 And I was thinking, you know, it's probably done now, isn't it? Let's see who won. Because I think we were at the point where we were at the Elite Eight, weren't we? Or, yeah, I believe we were at the Elite Eight. So we had a showdown between NumPy and Pip. NumPy crushed it. We had a showdown between Pandasy and Pip. NumPy crushed it. We had a showdown between Pandas and Requests. Pandas crushed it.
Starting point is 00:32:47 And it was an all data science finale. And NumPy and Pandas went head to head. And it was Pandas, 55% taking the winner. So I just want to do a quick follow-up on that. Very important news. We have a champion. It's good, but try using Pandas without NumPy. That'll be tough.
Starting point is 00:33:03 There you go. Yeah, indeed. I was... Pat, do you have anything else you want to give a shout out to? I do have one extra.
Starting point is 00:33:12 Okay. Quick click. It's easy to bash Microsoft, but they've been involved. They bought GitHub. They have lots of our Python core
Starting point is 00:33:21 developers working for them. They do. And they have this rewards program and they want you to use Bing search, obviously, but what you can do is choose a, uh, a charity to give points to. Um, you can also get like a $5 gift certificate to AWS or Amazon or something, um, for yourself, if you'd rather.
Starting point is 00:33:41 And, and every day you just kind of click on these little links and, and I just got five points or 10 points and, oh, now we got to do a quiz. I'll come back to that later. Um, and, and as you do this, you accumulate more points each day and those points then can go to your charity. And I did, uh, the red cross for a while. And I did the, uh, the CDC during our, our lockdown year there. And you can also donate to the Python Software Foundation. So that's a way we can all contribute. So if you're Googling stuff with Bing, go ahead and set up the rewards.
Starting point is 00:34:14 If you're Googling stuff with Bing, set up your rewards to go to the PSF. You might as well, right? That's right. That's fantastic. Awesome. Well, thanks. That's fantastic. Awesome. All right. Well, thanks.
Starting point is 00:34:25 That's a good one. I got a joke for you all here. And I know, Brian, you do as well. But I feel like this one, I better take this one because I don't feel you're in a position to make an unbiased decision here because it's so close to your heart. Okay. All right. Okay.
Starting point is 00:34:40 So this one is over on the Reddit Programming programming humor one, and it poses a question. What seems like a straightforward question for a piece of software? How do you exit them? And it types, there's some, you know, a couple of interesting options here. You get colon exit. 7% of the people think you type colon exit. They're wrong. You type colon WQ, which I guess if you want to make changes, cool.
Starting point is 00:35:06 Save your changes and exit. You could do, most people got that one. And then you could do colon quit, 7% again. You could click the close button. Hard for a non-UI app, but. Or almost 20% of the people said, you know what? The way you restart Vim, this horrible thing, I can't get out of it. I'm going to restart the computer.
Starting point is 00:35:26 I'm trapped in here. I thing, I can't get out of it. I'm going to restart the computer. I'm trapped in here. I just, I got to get out. I tried command Z or control Z and it just background it. And now what's it doing? It keeps coming back. And yeah,
Starting point is 00:35:35 I think people clicked restart the computer to be funny. I know. I know they did. I thought, and I pulled it up as a joke to be funny as well, but no, there you go. So have you,
Starting point is 00:35:44 I don't know that the, the close. So have you, I don't know. The close button works for me. I don't know. Well, it closes the terminal, right? Yeah. So, I mean, who doesn't? Well, you got to say, do you want to terminate the running program? Right?
Starting point is 00:35:58 You get like a warning that you're doing it wrong. I'm with you, Brian. I'm a boomer. It's not hard. And actually, I don't use straight Vim, except for on the command line. You're right. I guess I do that on the command line. But I do essentially use Vim within PyCharm or VS Code as well.
Starting point is 00:36:17 But yeah, Vim emulation. Yeah. Okay. It's fun. So I wanted to share a joke also, because I just thought this was so funny. I could stop laughing this morning. So ran across this tweet by Mediocre Superheroes. It's a little cartoon thing.
Starting point is 00:36:34 So the guy, you know, finds a genie. Genie says three wishes. Hey, can I wish for more wishes? Not with me. No. Well, fine. I wish you couldn't count i'm a genie uh done how many wishes do you have left a billion hmm that sounds right
Starting point is 00:36:53 i love it uh anyway that's funny it's an inventive way around an old joke so that's great anyway uh oh quick a bit of audience feedback as well henry schreiner says restart the computer isn't that how you get out of emacs also true yeah yeah what what key chord do i hit to get out of that one fantastic it's probably control something yeah i bet it involves a control K something somehow. Anyway, thanks for everything, Brian. Thanks for being here. Thanks for the jokes.
Starting point is 00:37:30 And Pat, it was great you could join us. Yeah, thanks, Brett. Thanks for having me on, guys. Bye, everybody. Bye, everyone.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.