Python Bytes - #126 WebAssembly comes to Python

Episode Date: April 19, 2019

Topics covered in this episode: Python Used to Take Photo of Black Hole Wasmer - Python Library for executing WebAssembly binaries Cooked Input JetBrains and PyCharm officially collaborating with A...naconda Building a Serverless IoT Solution with Python Azure Functions and SignalR multiprocessing.shared_memory — Provides shared memory for direct access across processes Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/126

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 126, recorded April 17th, 2019. I'm Michael Kennedy. And I'm Brian Akin. And Brian, we have a special guest, don't we? Yes. Yeah, Cecil. Cecil Phillip. Welcome to the show, man. Thank you so much for having me on. Appreciate it.
Starting point is 00:00:18 It's great to have you on the show. You've been on TalkPython. I've been on your podcast, Away From The Keyboard. So we might as well round this thing out, right? Yeah, we may as well go for the trifecta. Yeah, exactly, exactly. So super excited to have you here. We got a bunch of cool stuff to cover. Before we get to it, just want to say thank you to DigitalOcean for sponsoring this episode like they do many. Check them out at pythonbytes.fm slash DigitalOcean. More on that later. Brian, there's some really interesting news around Python being used for X, where Xs find the Higgs boson or get the Nobel Prize in economics or something else, right? You got a new one for us on that incredible list.
Starting point is 00:00:56 Yeah, I was actually, I was the last to the list. I was surprised nobody else took it. But in the news recently, there's a picture of a black hole, which is cool. And it's really neat that there's a bunch of Python involved in it. And of course, this is a big team with lots of software and whatnot. But a couple people did some digging. I'm linking to a quick write-up from Mike Driscoll. The Python used to take the photo of the black hole.
Starting point is 00:01:20 He's referencing a paper, which is a paper from the Event Horizon team. It includes references to lots of our favorites, like NumPy and SciPy, Pandas, Jupiter, Matplotlib, and AstroPy. So, yeah, lots of Python used in astronomy and in this black hole picture. That's so cool. And the reason this is a big deal is this is literally the first picture of a black hole ever, right? Yeah. One of the reasons why I linked to this article as well is it links to a TED talk from a couple of years ago, basically of how they took some of the concepts around how this picture was generated, not the technical part, but just in high level concepts and that there's a lot of people involved in it.
Starting point is 00:02:00 And it's a pretty big deal. And I'm looking forward to every time anybody ever asked me for the rest of my life, so what can you do with Python? I can say, well, we helped with the entire picture of the black hole thing. So whatever you need it for, we could probably handle it. Yeah, that's pretty awesome. I wonder if it was used in the detection of the gravitational waves for black holes as well. So maybe that'd be a nice way to round it out. But I honestly don't remember there. Cecil, are you into astronomy? I am a little bit, to be honest with you. We actually have the Kennedy Space Center that's pretty close by. I'm in Florida for everybody that's listening that doesn't know. And so it's definitely something that we'd love to go over and do. There's like a little
Starting point is 00:02:40 observatory in there, if you remember. So it's really kind of interesting to take the little one over and see how excited he gets over stars and planets and those types of things. That's so cool. I've definitely been to Kennedy Space Center as well, taking my daughter there. And it's a great place. And it's so awesome that Python and all these tools, I mean, this is like the big hitters list of all the data science in Python used for this real cool discovery. Yeah, this is amazing. You should definitely get, I can't remember her name at the moment, but the girl that they attributed to taking the pictures on your show.
Starting point is 00:03:09 Yes, Dr. Bowen, Bowman? Yeah, I almost have it right. Katie Bowman. There you go, yeah. That's right. And she, yeah, I've invited her to the show as to talk Python. It would be great to have her come and talk about this
Starting point is 00:03:19 because it's so exciting. You know, what's really unfortunate is there was such a weird internet backlash against her in particular. There were so many trolls and other weird stuff. For example, I tried originally to reach out to her through Twitter and somebody had set up a fake account with pictures of her and video posts and all sorts of stuff to make it look real, but it got suspended because apparently it was, I don't know what the deal is, you know, sorry that she had to go through that, but it's awesome.
Starting point is 00:03:47 This is the stuff she's doing, which is really cool. Yeah. That's really sad to see. I mean, it's, we all have a very supportive community in developer relations in general, but, um, you're always going to have one or two folks that are going to just, you know, just try and be nasty for no reason. You know, I think what she's done was totally amazing. And I think she deserves all the credit that she gets for it. Absolutely. The problem is, you take 1% of 1% of 1% of people
Starting point is 00:04:11 who are absolute jerks, and then you put them on the internet where they can reach out to you all the time. It feels like there's way more jerks than there actually are. But yeah, I still got to deal with it. It's a bummer. Definitely. Yeah. Cool. So Cecil, something I'm super excited about is WebAssembly and the possibility to bring various desktop or native code to browsers, right? So you don't have to just go, well, does it compile to JavaScript and run in JavaScript? Like WebAssembly essentially is this new standard that's in most modern browsers today. And essentially it allows you to target somewhat of a virtual machine, right? But essentially it's running in the browser. And so if whatever your language of choice happens to be can compile down into WebAssembly, then you could run it in the browser. What I actually ran into when I was on Reddit was this thing called Wasimer. And what this is, is a project that allow you to take that WebAssembly output, right, and run it in a Python application,
Starting point is 00:05:10 which is kind of interesting. Yeah, that's like the opposite of what I expected, actually. Right. It's actually pretty interesting. So this is not Python running on WebAssembly in the browser, although I'm pretty sure there's a few projects that can do that. This is Python taking the WebAssembly output, the.wasm file, W-A-S-M file, and running it in your Python application, which is interesting. So if you think about, again, WebAssembly allows us to run these different languages in the browser. So if we have these different languages targeting WebAssembly, and then we have a Python module that allows us to run that executable, essentially, we could run any language on Python, right? Or at least we'll have that ability to interoperate between all these things,
Starting point is 00:05:50 just using WebAssembly as that common language, I guess, that we're all speaking. That's so cool. So what we have in Python now is you can compile stuff to C and then use the C extensions and bring it in and run it. But this means anything that compiles to WebAssembly can now execute sort of natively in Python, regardless of whether there's like decent integration between those two languages. Yeah, I think that's really interesting, right? And so this is like the essence of cross-platform software development, right? Like when you think about it. You know what I thought about when you said this is like, I was thinking like, oh, this is kind of like Node. I can take stuff that used to be on the web, but now I can run it locally. But running it
Starting point is 00:06:26 instead of JavaScript, I run it like Python. But it takes anything that was on the web, which is pretty wild. Exactly. So the folks that are really behind this WebAssembly movement was actually Mozilla. And so they already have some implementations of their Rust programming language that targets WebAssembly. So I could write Rust that builds down to this.wasm file and then run it in my browser. So now imagine I could write something in Rust or C or something like that that targets this web assembly file and I could just run it in Python, right? So
Starting point is 00:06:53 if there so happens to be something that's missing or a module that I want to use, I could totally just bring it into my Python application and just use it. I'm pretty excited about this. I'm thinking I can use some of the awesome Python testing tools to test my WebAssembly projects. Yeah, probably too. That'd be pretty interesting to try out.
Starting point is 00:07:09 I ran this a little bit yesterday just to try it out and it actually works pretty well. And so now as the WebAssembly community just starts to grow, you can imagine as these different runtimes and languages want to start a target WebAssembly, that just kind of opens up the world to everybody else, right? Because now I can just pull this into my Python application and just run them. I love it. This is a super cool find. Yeah. I mean, I don't know how much of the, is this now, but I can see a future where there will be stuff that's like web assembly only, you know, once the adoption is greater, you're like, oh, that's only available in web assembly. Like, well now it's also available in Python. I love it. And Brian, I think you totally could,
Starting point is 00:07:42 right? There's an example here. That's a Rust function that takes two numbers and returns the values and things like that. And then the Python example of calling it. So yeah, you could wrap that up in PyTest, I think. Pretty sweet. Yeah, Cecil, that's a really, really cool one. The next one I want to talk about is called Cooked Input. And this one is a really cool little project.
Starting point is 00:08:02 Do you remember Bullet, Brian? Yeah. Cecil, I don't know if you caught this one, but Bullet is this library that lets you basically create drop-down combo boxes in the terminal with arrow control and scroll bars and stuff. So you can say, I would like to ask the user for this, and here's the five options. And then the five options is like a drop-down with the things,
Starting point is 00:08:24 and you can arrow through it and stuff like that. And it also has some features to say, and here's the five options. And then the five options is like a dropdown with like the things, and you can like arrow through it and stuff like that. And it also has some features to say, I want a number from you, like with some limitations. So cooked input is like that latter half to the extreme. So you can do all sorts of cool stuff. And the name comes from the idea of like Python 2, the way you got input from the user was raw underscore input. So validated input is cooked input, not raw input.
Starting point is 00:08:44 Yeah, that kind of thing oh i like that nice yeah it's funny right so the idea is you can ask for all sorts of stuff and it has this cleaning and this converting option and then this validation option so i could go and say i'd like to say go to the user and get a string called what i ask the prompt is what is your name and of course you could do that with input. But here you can specify like, I would like whatever they type to be transformed to cap words. So like, if you type your name, all lowercase, or like, it'll put just first capitalized first letters and everything else is lowercase. Or you can say, like, I would like to get an integer, how old are you? And the minimum
Starting point is 00:09:21 is one, you know, it just keeps asking the question and tells you what's wrong until it gives you the answer so it's a really nice way to get input from the user on the terminal that's like pre-validated that's pretty interesting so let's say could i do something like i'm gonna say a very bad word here use regex and do something like get like my date formatted a certain way or four numbers inputted a certain way. Yeah, it has all these different validators. And some of the validators have to do with dates and other types of things. So give me an email address. Give me a date. And give me an example of the year, month, day, or whatever.
Starting point is 00:09:57 And it won't let the user go on until they answer it correctly. That's pretty cool. Pretty nice. Brian, what do you think? You like it? You're bringing up Bullet. Is there a reason? Is it just a similar project?
Starting point is 00:10:06 I bring it up because it's another utility or library that takes just get standard input from the user on the terminal and makes it a lot better. Yeah. Okay. Right. It's kind of like not exactly a competitor, but a similar but different take on that idea. Probably can use them together. Like if you wanted to do these free form entries,
Starting point is 00:10:26 get it through. Yeah. And then drop down. Yeah. I wouldn't see why you couldn't do that. This also sort of came inspired by bullet because our listeners are awesome. Anytime we mentioned something that we thought was like, Oh,
Starting point is 00:10:37 here's this new unique thing. Well, you've never heard of the right. And here's five other amazing ones. You also haven't heard of and talked about yet. Right. Yeah. So pretty cool.
Starting point is 00:10:44 All right. Before we get to the next one, let me tell you all about DigitalOcean. So DigitalOcean run our infrastructure. They're really great. Super happy with them. And one of the things they've recently done is launch their DigitalOcean marketplace, which is cool. So you just go to the marketplace and you say, I would like a pre-configured Linux machine that's set up to run Django properly, like with MicroWhiskey and GUnicorn and all that. Or I want a MongoDB server, or I want a Ghost server, whatever.
Starting point is 00:11:10 And you just say, I want one of those, and bam, it just creates the whole virtual machine droplet ready to go, pre-configured. So they've got GitLab Enterprise, Nginx, Postgres, CertBot, all that kind of stuff that you might need. So quite cool. Just one of the things you can get at DigitalOcean
Starting point is 00:11:26 to get started more easily and quicker. So check them out at pythonbytes.fm slash DigitalOcean. Get a $100 credit for new users. Brian, you're starting to be a fan of PyCharm these days, right? I'm slowly, slowly wearing off on you. Is that right? Oh, no. I've been using it for a while. But I use it with
Starting point is 00:11:41 VI mode, of course, because I can't unlearn vim it's just built into my head now so one of the things i've been trying to do is uh use more jupiter notebooks for various uh presentations and tutorials and stuff and uh just playing with stuff especially with big data sets but it bugged me that maybe there's a way to use VI within a web browser, but I don't know how to do it. But I can do it within PyCharm. And so the neat thing that I'm announcing right now, I guess I'm not really announcing it, I just want to highlight it, is that JetBrains and PyCharm, they have announced that they're working with the Anaconda group to get more support for things like conda environments and notebooks into PyCharm.
Starting point is 00:12:28 And I'm using the 2019.1.1 recently, the most recent build, and the pro version, of course, but it makes it so that I can just edit my notebooks within PyCharm with the Vim emulation, all my normal things that I have hooked up to PyCharm, and it just works great. I love it. That's super cool. And they have a special distribution for PyCharm for Anaconda, which has even better support. Now, I don't do much with Anaconda. I'm a fan of it, but I just don't have a use case for it.
Starting point is 00:12:58 So I don't know a whole lot about it, but that sounds pretty cool. I don't use it myself either, but I know that a lot of people, especially if they're behind firewalls and stuff, it's just an easier install for other people to put that on there. That's pretty cool. Cecil, you ever use PyCharm or being at Microsoft, are you mostly on the Visual Studio Code side of the world these days? To be honest with you, I'm still a big PyCharm user. Like I was using PyCharm prior to coming to Microsoft.
Starting point is 00:13:21 I still use it a little bit. I do use our Python extension for Visitor Studio Code, depending. That's getting nicer and nicer. Yeah. Yeah, it's getting better and better. And people love it, obviously, because it's free and it's open source, and you can contribute back to it. But honestly, I'm still a PyCharm guy.
Starting point is 00:13:37 I think when you think about IDEs versus editors, there's a different use case for those, right? I'm like, there's a group of folks that just need an editor, making really quick changes or just going through your run-of-the-mill edits, builds, view type lifecycle. I think when it comes down to debugging and really getting deep introspection into what's
Starting point is 00:13:57 happening into your application, you honestly can't beat the power of an IDE. I'm sorry, Brian. I know you're a VI guy. I apologize. I'm 100% in PyCharm now. You just have it set up in VI mode. Yeah, I tried that for a minute.
Starting point is 00:14:11 Then I was like, whoa, somebody broke my PyCharm. I got to disable this extension here. That was when we were playing with AceJump, which is really cool. But that's a different topic for a different time. Yeah, so over at Azure, you guys have some interesting stuff
Starting point is 00:14:26 going on there. And one of the big trends, I don't know if it's really where the world is, but it's certainly where a lot of the hype and excitement is, is around serverless code, right? Yeah, definitely. So serverless is where we hide your servers from you. I'm like...
Starting point is 00:14:41 So it's essentially like we're just taking the burden away from you in terms of capacity capacity planning, right? So that means that the servers are still there, but essentially all you need to do as a company, as a developer is just, you just need to give us your code or, you know, uploaded a GitHub or what have you. And then we'll take care of deploying it, scaling it and doing all those types of things. So again, like you'd have to worry about this is how many virtual machines I need, or this is how much RAM I need. Don't worry about backups and some of those types of things.
Starting point is 00:15:09 But along with serverless, you start to see some interesting workloads that people want to build with them, right? So a lot of folks use it for APIs or the mobile backends to your web applications. Actually, I found a really interesting article yesterday, and this is on dev.to, which is a really cool online community for developers of, you know, this guy that created this serverless solution using Python, and it connected it to a Raspberry-way communication to your IoT device. And so we connected to that and then we send information over into Azure Functions. And then now he has like this real-time
Starting point is 00:15:51 chart of telemetry showing up in web browser, which I thought was pretty cool. So the pieces that he has connected to this are pretty straightforward, right? So he uses, again, he uses Python. He uses D3 for actually generating the charts. Oh, nice. Yeah, D3 is beautiful. Yeah. Yeah. And he has this thing called C3, which I never heard about before. So C3 sits on top of D3 and makes D3 easier specifically for creating charts.
Starting point is 00:16:14 Okay, nice. If anybody's ever used D3, you know it's not like the easiest learning curve thing. You can do more than just create charts, but there's a charting library on top of that, which I think is actually pretty cool. But again, this article is pretty interesting. Again, it uses Visual Studio Code and the Python extension. It uses functions, serverless functions,
Starting point is 00:16:31 and it shows you how you can take telemetry from an IoT device, specifically a Raspberry Pi, push it up into the cloud, and now you're getting like this real-time telemetry. So if you think about it, like, I don't know, maybe you have like a garden in your yard and you want to have like moisture sensor or even a heat sensor or anything like that. Like you could start to get like interesting telemetry from your house or from your different devices and then push it up into a real time chart using Python. That's a really cool use case. And I like the way they lay it out. What's really interesting to me is the two way communication.
Starting point is 00:17:02 Like calling into your Raspberry Pi seems more interesting than it talking out or more impressive, I guess. Yeah. So when you think about it, I mean, messaging is a hard thing to do sometimes, particularly when you're talking about a device that you don't necessarily have close by, right? And so definitely IoT Hub helps a lot with this. But I think for this particular use case is just using it one way, but you can go both ways if you needed to. Yeah, that's pretty cool. I like it. So if anybody wants to create a cool IoT thing, here's a nice little write up with Python and Azure. Yeah. What would you create with IoT? If you could, like Brian, and I talk about this every now and then I was like, it's
Starting point is 00:17:38 so cool. But I actually can't think of anything I want to build that's, you know, not already out there. Like what would you build with some sort of iot stuff if you had some time and energy i have two co-workers that actually built some interesting things and i think i might copy them so i'm gonna call them out a little bit so one of my co-workers lives in tampa and so he's in the barbecue and he has like a professional grade barbecue grill in his backyard he has like multiples of them so we went over to his house one day for barbecue and i'm like dude like what are all these wires you have attached to this grill he has a sensor attached to the grill that's you know checking temperature and whatnot and he had a raspberry pie could you not like hanging from the grill that was connected to his wi-fi in his house
Starting point is 00:18:19 and it was pushing telemetry to grafana that was running on a server in his house. If folks on the letter listening don't know what Grafana is, Grafana is essentially like an open source dashboard. You send it some information and it just generates a chart for you. So he has this Grafana chart that's in his house. And so he can look and see, oh, well, this is what temperature the steak is. And this is what temperature the sausages are. I thought it was super cool. That's pretty awesome.
Starting point is 00:18:44 Brian, have you come up with any IoTot things yet actually i'm intrigued by this whole barbecue thing and it sounds great to me you could even have extra probes in there to just to probe your meat while it's cooking what's cool with the two-way communication now is that so now he could look at it and be like okay this is hot enough and then he could turn it down right because again it's you could do bi-directional communication with your device right so when you say it's getting too hot or maybe it's not hot enough the iot device again because it's connected to the temperature gauge like he could adjust it but he doesn't have to be right next to his grill that's cool yeah and you could do a feedback loop
Starting point is 00:19:16 a control loop and have like a an ai actually cook your food for you then yes exactly you could do like 10 good grillings and then just like feed it to like some ML and go do more of that. That was good. I actually like that. So maybe that's my project now. I'm going to have ML cook food for me. That'll be awesome.
Starting point is 00:19:34 That actually would be incredible. I would love to have some ML cooked barbecue with you. That'd be great. All right, the last one is not nearly as fun as machine learning cooked barbecue, but it's pretty useful. So in Python, the whole threading parallelism story is a little bit complicated, right? We've got threads, but they can only do IO bound stuff.
Starting point is 00:19:52 They can't really do computational stuff because of the GIL. We've got async and await, and that's really even better for IO driven concurrency, but it also doesn't work with the computational stuff. So if you really want to do computational concurrency, you have to use multiprocessing or C or something like that. Right. But the way you've exchanged data while those are running has been somewhat limited, like certain structures can be shared. And, you know, you wait for the response to come back from the thing you're running over there. So new in Python three, eight, there's a new set of modules called multiprocessing dot shared memory. And the idea is you can create shared memory segments that are directly shared
Starting point is 00:20:33 with all the multiprocessing sub processes that are running in your parallel work. So if you're doing any multiprocessing, it's pretty cool. And a lot of it's fairly complicated. You're like reading and writing bytes directly, which sounds kind of gnarly, but there's also a shareable list, which is pretty cool. You can throw stuff on the list, you can pull stuff off the list, and it's shared just like straight shared memory across the various processes, which I thought was a pretty cool addition. I'm wondering, so does it control access to who's writing? Because I'm guessing multiple people can't write to it at the same time. So I'm guessing there must be like some type of control that says this person's writing first and then this who's writing because i'm guessing multiple people can't write to it at the same time so i'm guessing there must be like some type of control that says this person's writing first and then this person's writing second kind of thing one would hope there's some serialized
Starting point is 00:21:11 like shared critical section or something that doesn't let it like corrupt the shared memory but yeah it's still pretty i haven't looked but i would guess so i didn't see anything in the documentation about explicitly programming for that it was just like you see anything in the documentation about explicitly programming for that. It was just like, you put something in the list, you get something out of the list. But I bet internally, it's probably down at the C level or something. It's pretty careful about that. Sure. At the very least, this is a building block that we can build things like that on top of. It's pretty cool.
Starting point is 00:21:36 And it's nice to see, you know, new stuff coming in the threading world or parallelism word on Python. So this is like I said, brand new in 3.8. So it's cool. Yeah, nice. Indeed. All right. Well, guys, that's it for our main items but there's always a few extra things at the end
Starting point is 00:21:49 to talk about so uh brian what do you got that you want to throw out there well i'm just totally gearing up and getting excited for pycon i just got my stickers ordered so i'm gonna have uh also bring in a bunch of copies of the pytest book book. Try to sell some of those there. I only took like four last year and they sold out. So I'll bring more this time. Probably on your way to the booth, right? People mobbed you and got your book before you could even set them down. Yeah, I was going to bring a whole bunch, but it turns out that like a whole bunch of books is heavy.
Starting point is 00:22:16 So I'll bring some. That sounds good. Also, I've never done live interviews for Testing Code. I think it'd be fun to do some live interviews. You've done those before. So I'll pick your brain on how to do that best and get some of those set up. Absolutely. I'm super excited about some live recordings at PyCon. I'm sure you and I'll do some open session live Python bytes, but there'll also be some other stuff happening as well. I actually just bought some two little cool desktop mic holders for exactly that to bring
Starting point is 00:22:43 to PyCon. So we'll see how they work. Nice. How about you, Cecil? In terms of sharing, so I actually found a workshop online that I thought was pretty cool. So you know, everybody's always talking about machine learning, and I want to get into it, but I don't know what exactly I could do with it. So I found this interesting Python workshop, and it's called Attendee Detector Workshop. okay so essentially you go through this process of creating a flask application but essentially what you do is like you know you upload a picture
Starting point is 00:23:10 of like let's say a group of people or the audience or the background or what have you and using machine learning like it'll help you like pick out the people that are in like the faces of the people that are in that picture that you put out and then it'll tell you like if they're smiling if if they're happy, if they're sad or what have you. So I think it's pretty cool. So you can imagine, again, as a speaker or, I don't know, maybe you go to a basketball game or something, you take a picture
Starting point is 00:23:33 and you can be like, hey, I don't really think these people are really interested as to like what you're saying, what's going on here. Or hey, like somebody just scored like some points, right? Like I'm really super excited about it. But I think it's a really interesting practical application of using machine learning, but also something that's very approachable because I think it's something that we all can relate to. I think that's awesome.
Starting point is 00:23:51 It would be really cool to get a camera and point it on your audience while you're doing a presentation and just have like a little meter of like audience engagement as like that only you see while you're presenting something unrelated to this. And it'll show you like the faces of the people that aren't paying attention. So you could like walk by them and like stare. You've been singled out by the AI. We have to talk. Exactly.
Starting point is 00:24:12 I thought that was pretty cool. So I put that on the extras. Another thing I wanted to talk about too, so I've actually downloaded your TalkPython mobile app. I have it on my phone actually. Nice. So I took it with me when i was traveling last week and actually say i actually pretty like it i know you've been working on this probably for a
Starting point is 00:24:28 while and we spoke about doing offline video content and whatnot for your show so i'm really happy to see that this came out man this is super cool yeah thanks i'm really happy the way it came out as well and it's it's really fun like even i am experiencing going through my courses differently you might think well why would you do that but i have other authors i'm going through my courses differently. You might think, well, why would you do that? But I have other authors. I'm going through their content. They're going through mine, right? Like I'm kind of a student as well.
Starting point is 00:24:50 And it's super fun. We almost have the iOS version out, just the Android currently. But yeah, it's super, super close. So that was a fun project. Let's see, I do have a couple other things I want to throw out as well. There's an interesting interview with Guido van Rossum
Starting point is 00:25:03 on MIT's AI podcast. This was sent over by Tony Capanelli. Thanks for sharing that with us. And this is just, you know, it's not really worth going into the whole thing, but it's a different look at his perspective, like his perspective on science fiction and on machine learning and on just all sorts of stuff. So if you've got an hour or something, you want to just catch up with Guido and sort of a historical look on what he did and his accomplishments, it's pretty cool. Another one, Cecil, in the whole Microsoft realm
Starting point is 00:25:32 is Visual Studio IntelliCode for VS Code, which is pretty awesome. So we talked about some other projects that are like this, but this is, I think, a more legitimate one. So IntelliCode is like autocomplete intellisense but actually is based on the usage of your code so this works for python among other things and it goes through like say popular libraries on github so when you go to your if you install this extension say vs code and you go to you hit you know rege dot, the stuff that shows up in the list first is not just alphabetical,
Starting point is 00:26:05 but is actually the most commonly used things for, like, say, popular libraries that use regex and stuff like that. So it kind of shows you in its contextual as well. So it's pretty cool that people can check that out and install that. And then finally, my buddy Dan Koster sent me this yesterday, it just made me laugh, somebody had, was running a Craigslist thing and gotten a message. Hey, you know, here's my proposal or something to your Craigslist ad. Click here to sign up and, you know, fill it out or whatever. And it turned out to be a complete scam. It was like craigslist.somerandomdomain.com.
Starting point is 00:26:40 And he's like, all right, well, I could just ignore this or I could write a program to destroy this guy. And so it's a video of him going through, figuring out where the, like basically what it does is it shows you a fake Craigslist login to steal your credentials. So he used requests and some other APIs to actually go and just overflow the guy's database,
Starting point is 00:27:01 you know, just generate like a hundred million fake logins and just blast them into his database. So that's enjoyable. Anyone who feels like a little bit of schadenfreude, you can watch that. It's pretty good. Nice. Nice. I love that. Yeah. It's pretty short and sweet. It is Python too. So it's a bit of a, bit of a knock on it, but still it's, it's all good and funny. Speaking of funny, Brian, what do you got for us, man? Okay. Well, I use the, our pie joke, which probably used it too much, but whatever. You can't use pie us, man? Okay. Well, I used our PyJoke, which I probably used it too much, but whatever. You can't use PyJoke too much. And Cecil, we got to tell you, the way we get our jokes these days, sometimes people send them to us, but we found that there's
Starting point is 00:27:33 a package called PyJokes. And if you pip install PyJokes, you can just go to your terminal and just type PyJoke anytime you need a developer joke. Are you serious? So it's just a package and it'll just randomly generate jokes? Exactly. It's beautiful. Do you know if it's like machine learning jokes or is it like just static jokes and they just give you one? I think it's static. Oh, okay. Yeah, it's just a list. But there's quite a few. Here's one. To understand recursion, you must first understand recursion. It's very meta. But I wanted to make a comment on that because we teach recursion to new computer science
Starting point is 00:28:01 people all the time and I don't use it. I never use it. It blows up your stack. I don't think I've used it once in 23 years. And I've never needed a Fibonacci sequence generator. That is that. Yeah, I kind of felt that way when I learned CS. I'm like, this is cool and mind blowing. But will I ever use this? After I saw your comment here, I decided to think about it. I probably have legitimately professionally used recursion like five times. Yeah, I can attest to that. I've probably done similar, to be honest with you.
Starting point is 00:28:28 It's not zero, but it's not very high given the number of years that we do this. Same for you, huh, Cecil? Yeah, because when you think about it, like what would you use recursion for, right? And it's probably,
Starting point is 00:28:37 more commonly you probably use it for like processing of lists of things, you know, and breaking up lists of things into different pieces. And now most programming languages have things that are in the box in their standard library that'll help you do that.
Starting point is 00:28:48 So, I really haven't had the need to go down that rabbit hole. Exactly. I agree. All right. I have one for you as well. I have two, actually, because I had to run PyJoke as we were talking about it. So, here's one. I really like this one.
Starting point is 00:29:01 A programmer was found dead in the shower. Next to their body was a bottle of shampoo. With the instructions, lather, rinse, repeat. They just did it until they died. An infinite loop. And then this one's special for you, Brian, because I just ran it and it came up in Pie Joke. How do you know whether a person is a Vim user? I don't know how. Don't worry, they'll tell you. Well, I use Vim. Oh, man.
Starting point is 00:29:30 I love our jokes that good. Oh, man. This is crazy. All right. It is. All right, guys. Brian, thank you as always. Cecil, thank you for being here. It was a lot of fun to have you on the show. Sure. Definitely. Thank you so much for having me on. Appreciate it. You bet. Bye, guys. Bye, everyone. Bye. Bye. Thank you for listening to Python Bytes. Follow
Starting point is 00:29:47 the show on Twitter via at Python Bytes. That's Python Bytes as in B-Y-T-E-S. And get the full show notes at PythonBytes.fm. If you have a news item you want featured, just visit PythonBytes.fm and send it our way. We're always on the lookout for sharing something cool. On behalf of myself and Brian Ocken, this is Michael Kennedy. Thank you for listening and sharing this podcast with your friends and colleagues.

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