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

Transcript #126: WebAssembly comes to Python

Return to episode page view on github
Recorded on Wednesday, Apr 17, 2019.

00:00 KENNEDY: Hello, and welcome to Python Bytes, where we deliver Python news and headlines directly to your ear buds, this is Episode 126, recorded April 17th, 2019. I'm Michael Kennedy.

00:10 OKKEN: And I'm Brian Okken.

00:11 KENNEDY: And Brian we have a special guest don't we?

00:13 OKKEN: Yes.

00:14 KENNEDY: Yeah, Cecil Phillip, welcome to the show man.

00:16 PHILLIP: Thank you so much for having me on, I appreciate it.

00:18 KENNEDY: It's great to have you on the show. You've been on Talk Python, I've been on your podcast Away From the Keyboard so we might as well round this thing out, right?

00:23 PHILLIP: Yeah we may as well go for the Trifecta.

00:26 KENNEDY: 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, more on that later. Brian, there's really interesting news around Python being used for X where X is find the Higgs Boson or get the Nobel Prize in economics or something else, right? You got a new one for us in that incredible list.

00:56 OKKEN: Well yeah, 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 what not but a couple of 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. He's referencing a paper which is a paper from the Event Horizon team. It includes a references to lots of our favorites like NumPy and SciPy, Pandas, Jupyter, Matplotliv and Astropy, so lots of Python use in astronomy and in this black hole picture.

01:38 KENNEDY: 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?

01:44 OKKEN: Yeah, and one of the reasons why I link to this article as well is that 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 there's a lot of people involved in it. And it's a pretty big deal and I'm looking forward to every time anybody ever asks 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 hand it.

02:18 KENNEDY: 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 honestly I don't remember that. Cecil, are you into astronomy?

02:29 PHILLIP: I am a little bit to be honest with you. We actually have a 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 love to go over and do, just like a little observatory in there, if you ever go. So it's really kind of interesting to you know take the little one over and like see how excited he gets over like stars and planets and those types of things.

02:49 KENNEDY: That's so cool, I've definitely been at Kennedy Space Center as well. Taken 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 and Python used for this so cool discovery.

03:03 PHILLIP: Yeah, this is amazing. You should definitely get, I can't remember her name at the moment, but the girl that they attributed taking the pictures on your show.

03:09 KENNEDY: Yes, Dr. Bowen, Bowman? I almost have it right, Katy Bowman.

03:13 PHILLIP: There you go.

03:13 KENNEDY: That's right, and I've invited her to the show.,Talk Python. It would be great to have her come and talk about this. Cause it's so exciting. You know, what's really unfortunate is there was such a weird internet backlash against her in particular. There was 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 in all sorts of stuff to make it look real. But it got suspended because apparently it was... I didn't know what the deal was. I was sorry that she had to go through that. But it's awesome the stuff she's doing, which is really cool.

03:49 PHILLIP: Yeah, that's really sad to see. We all have a very supportive community in developer relations in general. But you're always going to have one or two folks that are going to just try and be nasty for no reason. And I think what she's done, it was totally amazing. And I think she deserves all the credit that she gets for it.

04:05 KENNEDY: Absolutely. The problem is, you take one percent of one percent of people 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, its a bummer.

04:20 PHILLIP: Definately.

04:21 KENNEDY: So Cecil, something I'm super excited about is WebAssembly and the possibility to bring various either desktop or Native Code to browsers. So you don't have to just go, well does it compile to JavaScript and run in JavaScript? Like WebAssembly means you don't have to, right?

04:37 PHILLIP: Yeah, exactly. So just for everyone listening might be listening. WebAssembly essentially is this new standard that's in most modern browsers today. And essentially it allows you to targets somewhat of a virtual machine 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 into browser. What actually ran into when I was on Reddit was this thing called Wasmer. And what this is, is a project that will allow you to take that WebAssembly output, right and run it in a Python Application, which is kind of interesting.

05:11 KENNEDY: Yeah, that's like the opposite of what I expected actually.

05:13 PHILLIP: 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 products that can do that. This is Python taking the WebAssembly output the .wasm 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 like we could run any language on Python, right? Or at least we'll have that ability to interoperate between all of these things just using WebAssembly as like that common language I guess that we're all speaking.

05:54 KENNEDY: That's so cool. So what we have in Python now as you can compile stuff to C and then use the C extensions and bringing 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.

06:11 PHILLIP: Yeah, I think that's really interesting. And so this is like the essence of cross platform software development like when you think about it.

06:17 KENNEDY: You know what I thought about when you said this is like I was thinking like, this is kind of like Node. I can take stuff that used to be on the Web, but now I can run it like locally but running instead of like JavaScript, I run it like Python, but it takes anything that kind of was on the Web, which is pretty wild.

06:31 PHILLIP: 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 targets, that the builds down to that .wasm file and then run it in my browser. So now imagine I could write something and Rust or C or something like that, that targets this WebAssembly. And I can just run it in Python. So, if there's so happens to be something that's missing or a module that I want to use, like I could totally just bring it into my path on application that just use it.

07:00 KENNEDY: I'm pretty excited about this.

07:02 OKKEN: Think that I can use some of the awesome Python testing tools to test my WebAssembly projects.

07:07 PHILLIP: Yeah, probably too. That'd be pretty interesting to try out. Hey, ran this up a little bit yesterday just just to try it out and actually works pretty well. And so now as the WebAssembly community just starts to grow, you can imagine as these different run times and languages and want to start a target WebAssembly, that just kind of opens up the world to everybody else cause now I can just pull this into my Python Application and just run them.

07:26 KENNEDY: I love it. This is a super cool fine. I don't know how much of that is it this now, but I can see a future where there will be stuff that's like WebAssembly only. Once the adoption is greater, you're like that's only available on WebAssembly. Like well now, it's also available in Python. I love it. And Brian, I think you totally could, 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 and pytest I think. Pretty sweet, Cecil, that's a really cool one. The next one I want to talk about is called cooked_input and this one is a really cool little project. Do you remember Bullet, Brian? Cecil, I don't know if you caught this one, but Bullet is this library that lets you basically create dropdown combo boxes in the terminal with like, Arrow controls so you can like and scroll bars and stuff. So you can say, I would like to get to ask the user for this and here's the five options and then the five options It's 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 limitation. 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_input. So validated input is cooked_input not raw_input so, that kind of of thing.

08:46 PHILLIP: I like that, nice.

08:47 KENNEDY: 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 would like to say go to the user and get a string called what I asked 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, 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? The minimum is 1. 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.

09:31 PHILLIP: That's pretty interesting. So let's say, could I do something like, I don't want to say a very bad word here, use regex, do something like gets my date format at the certain way or four numbers and input it a certain way?

09:44 KENNEDY: Yeah, It has all these different validators and some of the validators have to do with dates and other types of things. So like give me an email address, give me a date. And give an example of like the year, month, day or whatever and it won't let the user go on until they answer it correctly.

10:00 PHILLIP: That's pretty cool.

10:00 KENNEDY: Pretty nice, Brian, what do you think? You like it?

10:02 OKKEN: You're bringing a bullet. Is it a reason? Is it just a similar project?

10:05 KENNEDY: I bring it up because it's another utility or library that like takes just gets standard input from the user on the terminal and makes it a lot better.

10:16 OKKEN: Yeah, Okay.

10:17 KENNEDY: It's kind of like, not exactly a competitor but a similar but different take on that idea.

10:22 OKKEN: Probably can use them together. Like if you wanted to do these free form entries, get it through.

10:27 KENNEDY: Yeah, and then drop down. 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, here's this new unique thing where you'd never heard of it, they're like here's five other amazing ones you also haven't heard of it and talked about yet, right? So pretty cool. All right, before we get to the next one, let me tell you all about DigitalOcean. So DigitalOcean runs our infrastructure. They're really great, super happy with them. And one of the things they've recently done as launched 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 uWSGI and Gunicorn and all that. Or I want to MongoDB server or I want a Ghost server or whatever. 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 like GitLab Enterprise, Nginx, Posgres, Certbot, all that kind of stuff that you might need. So quite cool, one of the things you can get at DigitalOcean to get started more easily and then quicker, so check them out at Get a $100 credit for new users. Brian, you're starting to be a fan of PyCharm and these days, right? I'm slowly wearing off on you, is that right?

11:39 OKKEN: No, I've been using it for a while, but like I use it with 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 a use more Jupyter notebooks for various presentations and tutorials and stuff and just playing with stuff especially with big datasets. 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. 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.

12:48 KENNEDY: That's super cool. And they have a special distribution for Python for Anaconda, which has even better support now. I don't do much with Anaconda. I'm a fan of it, but like I just don't have a use case for it. So I don't know a whole lot about it. But that sounds pretty cool.

13:01 OKKEN: 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 that put that on there.

13:09 KENNEDY: That's pretty cool. Cecil, you ever used PyCharm or being at Microsoft you're mostly on the Visual Studio Code side of the world these days?

13:16 PHILLIP: To be honest with you, I'm still a big PyCharm user. Like I was using PyCharm prior to coming to Microsoft. I still use it a little bit. I do use our Python extension for Visual Studio Code.

13:27 KENNEDY: That's getting nicer and nicer.

13:29 PHILLIP: Yeah, It's getting better and better and people love it obviously cause it's free and it's open source and you can contribute back to it. But honestly, I'm still a PyCharm guy. I think when you think about IDE versus editors, like there's a different use case for those. There's a group of folks that just need an editor. Making really quick changes or just kind of going through like, I guess your run of the mill edits, builds, view type life cycle. But I think when it comes down to debugging and really getting deep introspection into what's happening into your application that you honestly can't be like the power of an IDE.

14:02 KENNEDY: Yeah, I'm with you.

14:03 PHILLIP: I'm sorry Brian. I know you like a VI guy, I apologize.

14:07 OKKEN: I'm a 100% in PyCharm now.

14:08 KENNEDY: Do you just have it set up in VI mode? Yeah, I tried that for a minute. Then I was like, Whoa, somebody broke my PYCharm. I got to just say, well, this extension here. That was when we were playing with Ace Jump, which is really cool. But that's a different topic for a different time. Yeah Cecil, over in Azure you guys have some interesting stuff 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. It's around Serverless code, right?

14:37 PHILLIP: Yeah, definitely. So Serverless is where we hide your service from you, I'm lying. So, it's essentially like we're just taking the burden away from you in terms of like capacity planning. 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 upload it to Github or what have you. Then we'll take care of deploying it, scaling it, and doing all those types of things. So again, like you don't have to worry about this is how many virtual machines do I need or how much RAM do I need or no need to worry about backups in some of those types of things. But an along with severs, it's like you start to see like some interesting workloads that people want to build with it. So a lot of folks use it for APIs or the mobile backends to your Web Applications. Actually I find it really interesting article yesterday, and this is on which has a really cool online community for developers of this guy that created this Serverless solution using Python and it connected it to Raspberry Pi to get like telemetry data. And so he connected the Raspberry Pi to these other offerings we have called Azure IoT hubs. And that allows you to do two way communication to your IoT device. And so we connect it to that and then we send information over into Azure functions. And then now he has like this real time chart of telemetry showing up in a Web browser, which I thought was pretty cool. So the pieces that he has connected to this are pretty straight forward. Again, he uses Python, he uses D3 for actually generating the charts.

16:03 KENNEDY: Nice, D3 is beautiful.

16:05 PHILLIP: And he has this thing called C3, which I never heard about before. So C3 sits on top of D3 and it makes D3 easier specifically for creating charts. If anybody's ever used D3, it's not like the easiest learning curve thing. You can do more than just career charts, but like 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 and then 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 get this real time telemetry. So if you think about it like, 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, you can 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.

16:55 KENNEDY: That's a really cool use case. And I liked the way they've laid out. What's really interesting to me is the two way communication. Callin into your Raspberry Pi seems more interesting than it talking out or more impressive I guess.

17:08 PHILLIP: Yeah, so when you think about it, messaging is a hard thing to do sometimes. Particularly when you're talking about a device that you don't necessarily have close by. 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.

17:24 KENNEDY: And that's pretty cool. I like it. So if anybody wants to create a cool IoT thing, here's a nice sort of write-up with Python and Azure. What would you create with Iot if you could like Brian and I talk about this every now and then I'm always like, it's so cool, but I actually can't think of anything I want to build that's not already out there. What would you build with some sort of IoT stuff if you had some time and energy?

17:47 PHILLIP: I have two co-workers that actually built some interesting things and I think I might copy them, so I'm going to 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 and he has like multiples of them. So we all 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 checking temperature and what not. And he had a Raspberry Pi, kid you not, like hanging from the grill that was connected to his WiFi in his house and it was pushing telemetry to Grafana that was running on a server in his house. If folks on there listening to let you know what Grafana is. Grafana is essentially like an open source dashboard. You set it some information and it just generates a chart for you. So he has this grafana chart that's like in his house and so he could look and see, well, this is what temperature to steake is, and this is what temperature like the sausages are. I thought it was super cool.

18:44 KENNEDY: That's pretty awesome Brian, have you come up with any IoT he thinks yet?

18:47 OKKEN: 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.

18:55 PHILLIP: 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. Cause again, you can do by directional communication with your device. When 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.

19:15 KENNEDY: That's cool.

19:16 OKKEN: Yeah and you could do a feedback loop, a control loop and have like an AI actually cook your food for you then.

19:22 KENNEDY: Yes, exactly. You could do like 10 good grillings and then just like feed it to like some ML then go do more of that. That was good.

19:30 PHILLIP: I actually liked that. So maybe that's my project. Now I'm going to have ML cook food for me. That'd be awesome.

19:35 KENNEDY: That actually would be incredible. I would love to have some ML cooked barbecue. That'd be great. 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 stories a little bit complicated. We've got threads, but they can only do IO bound stuff that can't really do computational stuff cause 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. But the way you've exchanged data while those are running has been somewhat limited, like certain structures can be shared and you wait for the response to come back from the thing you're running over there. So new in Python 3.8 there's a new set of modules called multiprocessing.shared_memory. And the idea is you can create shared memory segments that are directly shared 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, 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.

20:58 PHILLIP: I'm wondering, so does it control access to whose writing? Cause I'm guessing multiple people can write to it at the same time so I'm guessing it must be like some type of control that says this person's writing first and then this person's writing second kind of thing.

21:10 KENNEDY: One would hope there are some serialized like shared critical section or something that doesn't let it like corrupt the shared memory. But yeah, it's still pretty good. 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 put something in the list, you get something on the list, but I bet internally it's probably down at the C level or something and it's pretty careful about that.

21:32 OKKEN: At the very least this is a building block that we can build things like that on top.

21:35 KENNEDY: It's pretty cool and it's nice to see, new stuff coming in the threading world or parallelism ward on Python. So this is like I said, brand new in 3.8 and so it's cool.

21:43 OKKEN: Yeah, nice.

21:44 KENNEDY: Well guys, that's it for our main items, but there's always a few extra things at the end to talk about. So a Brian, what do you got that you want to throw out there?

21:52 OKKEN: Well, I'm just totally gearing up and getting excited for PyCon. I just got, my stickers ordered so I'm going to also bring in a bunch of copies of the PyTest book and try to sell some of those there. I only took like four last year and they sold out.

22:07 KENNEDY: Probably on your way to the booth people mobbed you and got you a book before you could even set them down?.

22:12 OKKEN: Yeah, I was going to bring a whole bunch, but it turns out that like a whole bunch of books is heavy. So I'll bring some.

22:18 KENNEDY: That sounds good.

22:19 OKKEN: 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.

22:29 KENNEDY: Absolutely, I'm super excited about some live recordings of PyCon. I'm sure you and I will do open session live Python Bytes, but they'll also be some other stuff happening as well. I actually just bought some two little cool desktop mike holders for exactly that to bring in a PyCon. So we'll see how they work.

22:45 OKKEN: Nice.

22:46 KENNEDY: How about you Cecil?

22:47 PHILLIP: In terms of sharing, so I actually phoned a workshop online that I thought was pretty cool. So, 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 find this interesting Python workshop and it's called Attendee Detector Workshop. So essentially you go through this process of creating a Flask application, but essentially what you do is like, you upload a picture of like let's say a group of people or the audience or the backyard 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 they're happy, if they're sad or what have you. So which I think it was pretty cool. So you can imagine again as a speaker or I know maybe you good ta basketball game or something and you take a picture and you can be like, hey, I don't really think these people are really interested too like what they're seeing or what's going on here. Or hey, like somebody just scored some points where 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 cause I think it's something that we all can relate to.

23:50 KENNEDY: I think that's awesome. 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 ambient of like audience engagement as like that only you see while you're presenting something unrelated to this.

24:02 PHILLIP: 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 stand.

24:12 KENNEDY: You've been singled out by the AI. We have to talk.

24:12 PHILLIP: Exaclty. I saw 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 Talk Python mobile App. I have it on my phone actually.

24:22 KENNEDY: Nice.

24:23 PHILLIP: Also, 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 while. We spoke about doing offline video content and what not for you show. I'm really happy to see that this came up. This is super cool.

24:35 KENNEDY: Yeah, thanks. I'm really happy the way it came out as well and 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 their content, they're going to mine. I'm kind of a student as well and it's super fun. We're almost have the iOS version out, just the Android currently but it's super close. So that was a fun project. Let's see, I do have a couple of other things I want to throw out as well. There's an interesting interview with Guido van Rossum on MIT's AI podcast. This was sent over by Tony Cappinali. Thanks for sharing that with us. And this is just, 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 is Visual Studio Intelecode for VS Code, which is pretty awesome. So we've talked about some other projects that are like this, but this is I think a more legitimate one. So intelecode is like auto complete intelisense 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 and say in VS Code and you go to regex., the stuff that shows up in the list first is not just alphabetical 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 and it's contextual as well. So it's pretty cool that people can check that out and sell that. And then finally, my buddy Dan Koster sent me this yesterday. It just made me laugh. Somebody was running a craigslist thing and gotten a message, hey, here's my proposal or something to your Craigslist Ad, click here to sign up and fill it out or whatever. And it turned out to be a complete scam. It was like craiglist dot some random 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 I am going through figuring out where like basically what it does is it shows you a fake craigslist login to just steal your credentials. So he uses Requests and some other APIs to actually go and just overflow the guys database, just generate like a 100 million fake logins and just blast him into his database. So that's enjoyable. Anyone who feels like it, you can watch that. It's pretty good.

27:12 OKKEN: Nice, I love that.

27:13 KENNEDY: Yeah, this is pretty short and sweet. It is Python 2 so it's bit of a bit of a knock on him but still it's all good and funny. Speaking of funny Brian, what do you got for us?

27:21 OKKEN: Okay, well I use the pyjoke, which probably used it too much but whatever.

27:27 KENNEDY: 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 is 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.

27:40 PHILLIP: Are you serious? So it's just a package and just randomly generate jokes?

27:43 KENNEDY: 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 once? I think it's static.

27:50 OKKEN: It's just a list.

27:51 KENNEDY: But there's quite a few.

27:52 OKKEN: Here's one. To understand recursion, you must first understand recursion.

27:56 KENNEDY: Very Meta.

27:57 OKKEN: But I wanted to make a comment on that because we teach recursion to new computer science 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. There's that.

28:15 KENNEDY: Yeah, I kind of felt that way when I learned CS I'm like, this is cool and mind blowing, but why 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.

28:25 PHILLIP: I can attest to that. I've, I've probably done similar to be honest with you.

28:28 KENNEDY: It's not zero, but it's not a very high given the number of years I've been doing it. Cecil, you have something?

28:34 PHILLIP: Cause when you think about it, like what would you use recursion for? And it's probably more commonly, you'll probably use it for like processing of lists of things? And breaking things into different pieces and now most programming languages have things that are in the box when the standard library that'll help you do that. So I haven't had the need to. Go down that rabbit hole.

28:51 KENNEDY: Exactly, I agree. 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 liked this one. A programmer was found dead in the shower. Next to their body was a bottle of shampoo with the instructions, lather, rinse, repeat. He just did it until they died. An infinite loop. And then this one is special for you, Brian, because I just ran it and it came up in pyjoke. How do you know whether a person is a Vim user?

29:20 OKKEN: I don't know how.

29:21 KENNEDY: Don't worry, they'll you.

29:26 PHILLIP: Well, I use Vim.

29:30 KENNEDY: I love our jokes, they're good.

29:34 PHILLIP: This is crazy.

29:36 KENNEDY: It is, all right guys. Brian think you as always. Cecil, thank you for being here. I was a lot of fun to have you on the show.

29:41 PHILLIP: Sure, definitely, thank you so much for having me on appreciate it.

29:43 KENNEDY: Bye guys, bye everyone.

29:44 OKKEN: Bye.

29:44 PHILLIP: Bye.

29:45 KENNEDY: Thank you for listening to Python Bytes. Follow the show on Twitter via @PythonBytes, that PythonBbytes as in B-Y-T-E-S. Get the full show notes at If you have a news item you want featured, just visit and send it our way. We're always on the lookout for sharing something cool. On behalf of myself and Brian Okken, this is Michael Kennedy. Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page