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


Transcript #161: Sloppy Python can mean fast answers!

Return to episode page view on github
Recorded on Friday, Dec 13, 2019.

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

00:04 This is episode 161 recorded December 12th, 2019.

00:09 I'm Michael Kennedy and Brian Okken is not here today. Instead, we have a very special guest, Anthony Herbert. Welcome, Anthony.

00:15 It's nice to be here. Thanks for having me.

00:17 Yeah, it's great to have you here. You're doing all sorts of cool stuff in the Python space and I'm looking forward to sharing some of the week's news with you.

00:23 Also want to say thank you to DigitalOcean. They're sponsored this episode as they have many, many of them. So check them out at pythonbytes.fm/DigitalOcean and get a $50 credit for new users.

00:34 Anthony, people might know you from your website PrettyPrinted. You do a lot of stuff with Flask and things like that, right?

00:40 Yeah.

00:41 Yeah, cool. So people have checked that out. That's the same Anthony. And you're here with a bit of a contrarian story on getting stuff solved, right? And I actually really subscribe to this idea as well about using crappy code when it makes sense. Tell us about it.

00:57 This is from a talk by Larry Hastings. It's called "Solve Your Problem with Sloppy Python." And in this talk, he basically advocates solving personal problems with sloppy Python, not problems that you would have at work because that would be a huge issue. So in the talk, he gives three or four examples of how he solves problems that he has encountered in his everyday life. And three of the four have to do with string manipulation, so renaming files and I think that's something that everyone has had to deal with at some point. I know I have to deal with it all the time. And another example is a script that he uses to install all the packages after reinstalling an operating system. So instead of going through and trying to install each package individually, what he does is he just writes a script and installs everything that he uses. So Sublime, Chrome, and even the latest versions of Python. And as an example of some of the sloppy code that he has, when he goes to install the latest versions of Python. All he does is he goes to Python.org and he scrapes the latest version of Python there. So he gets the version number, then he can go and download the source for that, build the source, and then he has the latest version of Python installed without him having to actually do anything.

02:08 Yeah, I didn't catch that he actually was using that to build from source.

02:11 That's pretty funny. Yeah, but he's doing a lot of cool stuff. And I like this message. Like I said, I kind of subscribe to it. It's there are times that you should put tons of energy into structuring beautiful code that's very maintainable and very abstracted.

02:24 And like you mentioned, Anthony, when you were doing this on a team, if you create crappy code, your team members are not going to like you and you're like, oh man, I don't want to go work on that part of the code because you know, it's always like, there's like two features and three bugs, it seems to be the ratio or something like that.

02:41 Right.

02:41 But there's all these little things that, you know, like you don't need to do a lot of error handling, you're just going to run it and it's just, it just needs to do this thing and you're the one person looking at it.

02:50 And if it doesn't work, it's going to be obvious you'll get a big stack trace or trace back, something like that.

02:56 Right?

02:57 What the reason I like it is it allows people to say, instead of spending a lot of work on building something fancy to solve my problem, I can spend 10 minutes and solve it for the rest of my life.

03:05 Right?

03:06 Right.

03:07 Do you have situations in your world where you do that?

03:08 I have to move files around all the time.

03:11 And what tends to happen is like I start to do it and I feel a bit stubborn at times.

03:16 So I just continue doing it manually.

03:18 And then when I'm done, I realize, "Oh, I could have written a script for that." So what this talk basically reminds me to do is think about automating at first and do as much as I can in code and then minimize the manual parts.

03:31 There was something I did recently where I had to cut out pieces of audio files, starting at a certain time step and ending at a time stamp.

03:38 And I had to do that for about 30 files.

03:39 And it took me a couple of hours to do this.

03:42 And Audacity has the ability to be controlled by a Python script.

03:45 So perhaps I could have written a script to do that for me automatically instead of sitting in my computer messing with audio files for a couple of hours.

03:52 Yeah, and you can do that for a few hours, but eventually at some point you're like, this is really hard.

03:58 And in my own world, I've had a lot of these experiences to the point where I'm like, maybe I should hire someone to do this.

04:03 And then like, wait, wait, wait, I bet I could do this in Python, and then two hours later, it's automated.

04:08 I'm like, why was I ever thinking that?

04:09 What a fool.

04:10 So I threw out some examples onto the show notes of stuff that I was doing as well.

04:15 So there's a bunch of little things that just make my life so much easier.

04:18 If I export course sale data, I use Stripe, I got to get it out of their format as an Excel CSV, and then I got to convert it to something else that I process and filter and so on.

04:29 And I was doing that by hand for years.

04:32 Why am I always going into the sheet, deleting these columns, copying this stuff over there.

04:37 And I just wrote a Python script.

04:38 Now it's one line of command line call, runs a Python script, and it transforms my stuff into something I can just paste into the right sheet, a Google sheet, sort of calculation place.

04:51 Another one is I always have titles and stuff that I want to make into file names or folder names.

04:57 Think the title of this show or the name of a lecture, a video lecture in a course.

05:03 I want to take the title and make the file name that.

05:05 So I wrote this thing called URLify, and it was like 20 lines of code, because I was sick of lowercase e and putting dashes for spaces, taking away the dots, taking away the punctuation and I put that in as a gist, people can have it.

05:16 I do tons of reporting this way.

05:18 The deployment on my server, I turn that into the script that I can use with Python, it sort of does a bunch of stuff with actually async and await in there, which is pretty cool.

05:28 Importing information from video files, because I don't want to go there and copy, like it's this long and its name is this, so now I can just point it at the directory and it'll just rip that out of there or same thing for like duration of audio files.

05:39 there's all these cool little things that were nagging me that I had to do all the time and I'm just like you know what this is getting some Python on it.

05:47 Yeah sounds good. Absolutely. So I mentioned async and await and the place where async and await seems to have the most power right is around well network stuff. So it's either on the server side where you have a framework that is some kind of web server that can scale out better because the web methods are or async and await, or a client, something like requests, more like HTTPX or something like that that supports an async way to talk to a bunch of different services or websites.

06:15 The next thing I want to cover is this little write-up by Floramund Manka, and it's the introduction to ASGI, the emergence of async Python web frameworks.

06:27 We've probably all heard of WSGI or WSGI, that powers Flask and are things like Pyramid and Django and so on.

06:35 That's the web service gateway interface.

06:36 And it's, you've got a request, give me the answer.

06:40 And that just doesn't work when you want to allow multiple requests to all run at the same time, right?

06:45 If I'm gonna have a bunch of async stuff, I gotta let some pause and let some new ones come in and all that kind of stuff.

06:51 So one of the areas where I think there's a ton of growth, and I'd like to get your opinion on this, Anthony, is around these new Python web frameworks.

07:00 It used to seem really clear, like, yeah, Flash, Django, Pyramid, a few others. And now there's a new one every week. I don't even know what to keep track of anymore. How do you feel? Yeah, and I don't know what to keep track of either. Like I don't even know where to start. So I haven't, I haven't really looked into any of them closely. Some people on my channel have been telling me to look into Sanic. Yeah, Sanic's got a lot of traction. Yeah, that was the first one I heard about a couple of years ago. And it's still going pretty strong. I haven't looked into it yet. And it seems interesting. Like I've done a little bit of Node stuff in the past. And I know this is bringing Node-like functionality to Python.

07:32 So I want to look into it, but I haven't looked into it deeply yet. And I noticed that Django, they just released 3.0, and they have support for ASCI. I don't think it's completely functional yet, but the beginnings of it are there. So I should definitely look into it more.

07:46 Yeah, for sure. The foundations are there. And if you're a Flask person like you are, probably the best thing to actually start with might be Court. So I don't know if you've heard heard of court but court is a 100% compatible even with the extensions plugins and stuff for flask API but it also allows for async and await on the view methods so basically the way you convert from flask to court is you replace the word flask with the word court if it's lowercase flask it's lowercase court if it's uppercase flask it's uppercase court and that's it and then you have async methods you do have to run it on something like uvicorn but yeah that's probably the path of least resistance but it also doesn't take advantage of necessarily the best new features, right?

08:26 - That seems easy. I can try that last support.

08:29 - Yeah, you could definitely try that.

08:30 The thing is, when I first did that and I tested it out, I'm like, "All right, let's see how much faster this is." And I made the mistake of just running it as it traditionally had been, and it was running on a WSGI server, so it couldn't do any of the async stuff.

08:42 I'm like, "It's just the same. What a shame.

08:44 This is not working at all.

08:46 Like, oh, maybe I need a different server to enable this." Yes, that is what was missing.

08:50 So yeah, it's pretty cool.

08:52 And the thing is, the slower the external systems that you depend upon are, the better your performance is going to increase, right?

08:59 So if your database responds in 10 milliseconds, you can handle more requests if you switch it to async and await.

09:05 But you're kind of doing more work in that 10 millisecond window.

09:08 But if you're talking to a database that takes two seconds, or web services that take two seconds, all of a sudden you have a whole two seconds of what was blocked up web server to now go do kick off a whole bunch more waiting or something like that, right?

09:20 So it's pretty cool.

09:21 I'll look into that more.

09:22 Yeah, nice.

09:22 So they give a few reasons why you might care about this.

09:24 So they say speed, obviously, they're doing some tests and they say things like, well, they're getting 60 to 70,000 requests per second, whereas like synchronous flask and Django do like 10 to 20,000, right?

09:38 I mean, performance is always one of those things that's very hard to measure.

09:42 And if you had a very slow flask app, like I was describing, you would get a much bigger percentage boost and so on.

09:49 So pretty cool.

09:50 Yeah.

09:50 So they link to a couple of different tools you might use.

09:53 uvicorn, which is a like g-unicorn, but based on uvloop, which is the C implementation of asyncio event loop, and plugged in a g-unicorn, that's a good foundational production server.

10:08 And then starlet seems to be one of the best async frameworks.

10:12 Like you mentioned Sanic, and I talked about Cort.

10:15 Starlette seems to be the foundation.

10:17 It's like the foundation of FastAPI and some other ones, and it's its own framework, so it's pretty good.

10:22 There's a bunch of other things that are interesting, like HTTPX as a replacement for requests, where you have async there, ORM, which is an asynchronous ORM, 'cause if you don't have an async database call, then what are you waiting on, usually?

10:34 So a bunch of cool little things to bring together, and if you're getting interested in this async and await plus web frameworks, check out this article here, it's pretty nice.

10:42 Speaking of nice, let me tell you all about DigitalOcean.

10:46 They're making Kubernetes easier with their container registry in one click apps.

10:51 So when you create a Docker image, Docker containers, you've got to have a Docker file that says, here's exactly how to construct my Docker container.

11:01 Maybe it has some files it copies in and all that kind of stuff.

11:03 But you probably don't want to put that onto some public place like Docker Hub.

11:08 You might, but you may well be really reticent to do that.

11:12 So DigitalOcean introduced a new managed service, the DigitalOcean Container Registry.

11:17 And it's in early access now, but you can check it out.

11:19 It's simple, private, secure, and fast.

11:21 And you don't have to put your Docker file definitions up there somewhere where you would rather not put them.

11:29 So check them out at python.bytes.fm/digitalocean.

11:32 You usually get a $50 credit to get started.

11:35 So what's this next one you got here, Anthony?

11:37 So this is a blog called Python Insights.

11:39 And it's from someone named Tim Martin.

11:42 And in this blog, he just talks about the internals of Python.

11:45 So how Python works behind the scenes.

11:48 Because oftentimes when we write Python, we don't really think about what's happening when it actually gets executed.

11:53 So on the first page, for example, he has posts like how context variables work, how the import statement works, and how even Python is converted to bytecode.

12:02 And one post that I saw that was pretty interesting was called "Dictionaries Preserve Order." So when I first learned Python some years ago, one of the things that I learned about dictionaries is there's no ordering to them.

12:15 Because, you know, they're just hash tables. You put things in, and there's no guarantee on what order they'll come back when you go to look at the entire dictionary.

12:22 Well, apparently, since Python 3.6 or 3.7, there is ordering now. So the order in which you insert things into the dictionary is the order that is always going to be there.

12:32 So every time you look at the dictionary, you're going to see the things in the order that you inserted them. And this is something that I would never have suspected.

12:39 But they changed the implementation of how the memory of dictionaries work in Python.

12:43 And this is something that he looked into. So he goes to explain how all that works, how hash tables work in general, and why the ordering is there now in 3.7.

12:53 Yeah, nice. There's a bunch of just cool little insights.

12:55 Like, take that idea and just dive into it and explain it.

12:58 It seems like a good place, especially if you're getting started, and you want to dig into those ideas.

13:02 Yeah, the more you know about how it works, I think the better off you'll be.

13:05 Yeah, it's kind of cool they finally decided to make dictionaries ordered, right? It lets them be used in a few more places where maybe you actually need ordering and you're like, well, I could use a list and that'll have the order, but it'll be slow to get the items out. But maybe that's the trade off we have to make. And now you don't have to.

13:20 Right, right. And I noticed 3.8, they add a reverse function as well. Our dictionaries can work with reverse. So if you want to reverse your dictionary for whatever reason, you can.

13:28 Yeah, that's really taking the order seriously.

13:30 So this next one, since you're a big web developer, I think will be interesting to you, and you're into Flask.

13:36 This one is called Assembly.

13:38 Have you heard of it?

13:39 I have not.

13:39 Well, when somebody recommended it, Luis Honda sent this over and said, "Oh, you should check out Assembly." My first thought was, like, "Assembly language?" Like, I'm really not interested in Assembly language, but you said it's a web framework, so let me check this out.

13:52 And it turns out that this is like an API on top of Flask.

13:57 So it has its own API, but deep down, it's really flask, right?

14:01 And the idea is this person who wrote this project said, "I would like to build my web application using the concept of object-oriented relationships." So for example, if you want to have just bare routes, so like maybe just a slash for your homepage, you want to slash about for your about, slash contact for slash contact or something like that.

14:25 All you do is you create a class called index, and then you have functions, one called index, one called home, one called about, and it automatically sets up all the routing.

14:34 And at first, it sounds like, "Ah, you know, okay, how much is this really buying me in terms of..." I had that right, I could put app.route and put that in there, you may use a module to structure things that way.

14:45 But as you look through this more and more, there's just like all of these features.

14:51 So I put a link in here, it says, decisions made for you plus features.

14:55 And I'll just go through this, and Anthony, you tell me how these ideas hit you.

14:59 All in this one framework.

15:00 So it has smart routing, which I just described.

15:03 It has class names as part of the URL.

15:06 So if I have a class called user account, the URL will be of all the stuff, and then we'll start, be prefixed with user dash account.

15:13 Class methods can also be accessed in the same way, right?

15:17 It'll put dashes and whatnot.

15:18 It has a RESTful API.

15:19 It automatically figures out the view to render.

15:22 So in the templates folder, if you have an index class, in there you make a folder.

15:27 In that folder, you create, you know, I said there's a slash about, you put in an about.html and it'll automatically find that and render that as part of the template by just returning a dictionary.

15:37 So I like that.

15:39 Although you can edit it with route.

15:40 It also has built-in markdown support.

15:42 So if you have a markdown file, it'll process it and convert it to HTML.

15:46 - Okay, that's nice.

15:47 - Yeah, that's cool, right?

15:48 It has built-in support for passwords and it uses bcrypt, which is an awesome thing to do it.

15:52 It has session-based support.

15:54 You can use Redis, AWS S3, SQLite, Postgres, all these things as backend support for that.

16:00 It has ActiveAlchemy, which is a different take on SQLAlchemy.

16:06 So SQLAlchemy uses unit of work where you start the unit of work, you do a bunch of stuff, and then you commit it.

16:11 And this one is more active record, so each thing gets a change, but it's still SQLAlchemy underneath.

16:16 Ooh, I'll keep going though, 'cause these are cool, like cross-site request forgery on all posts automatically, idiomatic HTTP errors, storage can be like S3, mail support, arrow for time, caching, pagination, assets, signals for dispatching messages to other parts of your app, and a bunch of other stuff.

16:34 So that's a lot of things to add on top of basic Flask.

16:37 - Yeah, it is.

16:38 All those extra features sound great.

16:40 The main part that I noticed was using the class to organize your routes, and that's a little strange to me.

16:47 I'm used to just writing functions that are part of blueprints because I think that works so well that I haven't thought of a reason to switch that up.

16:56 But I'll definitely look into it because I'm sure there's a reason why this was done.

17:00 Like I don't like to dismiss things right away because I don't understand it.

17:04 If they spent the time to build this library, then there's a good reason.

17:07 So I'll look into it and I'll see what the advantages are of using a class for this.

17:10 - Sure, my two impressions, to me the things that seem like two advantages, There's some other stuff that I didn't mention about RESTful APIs and whatnot, but the two big ones seem to be automatic URL generation and grouping.

17:24 So if I have got like a blog class and then a, you know, latest post, like that latest method, it automatically says that slash blog slash latest.

17:32 And I don't have to think about that.

17:34 I think that is one part that's interesting.

17:36 Stuff that's grouped in that class is clearly grouped in a URL hierarchy.

17:40 And then the other is the automatic discovery and rendering of the template, If your template structure looks like the shape of your classes, then it'll just find the template without you saying flask render template and give the template name.

17:53 I don't know if that's enough to win people over, but I think that that's what they're going for.

17:56 Okay, yeah, and I always name my templates the same as the function, so that would definitely help.

18:00 Yeah, I try to do that too, but this thing just says, and we're going to use that to figure out what to render and whatnot.

18:05 So it's pretty new, and I think this is one of the challenges.

18:08 There's all these cool and exciting ideas, but it's just getting started, and you don't know which one is going to survive, right?

18:15 Like you've been doing a lot with Flask and you're like, "Well, maybe I should look at Sanic, but maybe Sanic won't be here in two months.

18:20 So maybe I shouldn't look at Sanic.

18:21 What else should I look at?" There's just so much churn, which is beautiful 'cause there's all these things coming, but at the same time, it means it's really kind of hard to pick a horse in the race.

18:29 - Yeah, Flask has a huge problem with this.

18:32 Like Flask itself is fine, but so many extensions, you know, they get popular, then there are no more maintainers after just a few months.

18:40 So you have to find a new library if you want to get the latest.

18:44 - Yeah.

18:45 All right, this next thing you have is pretty interesting.

18:48 Some physical hardware, huh?

18:49 - Yeah, so this is an article by Lennon.

18:51 It's called "Building a Standalone GPS Logger "with CircuitPython Using Adafruit and Particle Hardware." So I've never done anything with hardware because it seems kind of mysterious to me.

19:01 So reading this post was interesting because it kind of showed how straightforward it is.

19:07 Like obviously you have to figure out what components you need to build something.

19:10 But in terms of writing the code to control all this with CircuitPython, which is a version of Python for microcontrollers.

19:17 It's pretty straightforward.

19:18 It reminds me of taking data from an API and just writing it somewhere, so to like a database.

19:24 So in this case, you have the GPS logger, so that's like your API in a sense.

19:28 You have data coming from that, and you just take that data and you put it somewhere else.

19:31 So it's really that straightforward.

19:33 Obviously, you have some code to check if the hardware is working properly, but the actual code to do what you want is pretty straightforward.

19:41 So he built this GPS logger because he wanted a way to track his GPS location over time instead of just having the current location like your phone gives you.

19:50 And in a way that doesn't just drain your battery.

19:53 So he shows you what components he had to purchase and how he put them all together and then he gives you the code that he wrote to control all this.

20:02 I find it quite interesting. It makes me want to think about hardware projects I can attempt.

20:05 Yeah, it doesn't seem that out of reach, right? And it's not too expensive.

20:08 One of the things that I think is really challenging about these hardware projects, and Adafruit makes it better, because they have all these options, but I'm like, all right, maybe this microcontroller thing would work, and it's $10, and I probably need a battery.

20:22 I don't even know how to hook the battery to the microcontroller, and then I need the GPS thing, but will that hook on this, or do I need a board?

20:28 It's just like all the little parts, I'm like, what even goes together?

20:31 And so one of the cool things is, it's like, here are the seven things I used, right?

20:35 - Yeah. - Yeah, that's cool.

20:35 - Yeah, so it makes it approachable, and there are tons of tutorials as well for the beginners who want to get into hardware.

20:42 So I think, I'm pretty sure once you learn like the basics of what works with what, I think you can do similar things to what he's done in this tutorial.

20:50 - Yeah, that's cool.

20:51 So if you wanted to like go skiing and have a little trace of every bit you've done, you could just throw it into your backpack or whatever and just at the end of the day, it goes for like four days or something on its battery, it's got a little SD card, right?

21:04 Take the little SD card out and you just, you have all your data, you do whatever you want with it.

21:07 Sounds fun. - Yeah.

21:08 - Nice, so let me wrap up our main items here with a little article that folks can use to maybe make a case for using Python or learning Python at your organization or for yourself.

21:20 And it's called 10 Reasons Python is Good to Learn.

21:22 And pretty straightforward.

21:25 So, obviously Python is popular.

21:27 If you go and throw Python and all the other major languages into Stack Overflow trends, it's ridiculous.

21:35 I did this recently.

21:36 A couple years ago, Stack Overflow covered this and talked about, they wrote an article called "The Incredible Growth of Python" and they predicted Python just blowing past JavaScript and Java and all that.

21:46 It just really going and the others kind of going and flattening off.

21:49 If you go and put those same things into Stack Overflow Trends Now, Python is even more popular than they predicted and the other ones are going down more than they predicted.

21:56 It's ridiculous.

21:57 And so the question kind of becomes why?

21:59 And I think that this article touches on some of them.

22:03 But before I talk about it really quickly, I just wanted to throw out this idea that I have.

22:07 And it's that Python is a full spectrum language.

22:10 And this is an idea I'm trying to popularize about why Python is popular.

22:15 So on one hand, maybe, let's think of like a scientist, a biologist, or physicist, or somebody who's, they don't think of themselves as a programmer, let's just go with biology.

22:25 But the person has all this data and they can't properly analyze it in say Excel.

22:31 So they got to use some kind of programming, sort of in quotes, thing to work with it.

22:36 One option is they could use MATLAB, but MATLAB's like thousands of dollars, like $800 a year continuously, plus all the add-ons.

22:44 And the other thing is you can't build real apps with those kinds of projects, right?

22:48 Like nobody builds YouTube with MATLAB or Windows with MATLAB.

22:53 They just, it just doesn't do that.

22:55 On the other hand, you could pick other things that can do those sorts of things, like C++ or .NET or whatever.

23:00 and you're hit right from the beginning with all the complexity.

23:04 Like the biologists, instead of just being able to add a reference to a couple libraries, not even write a function, just write like 10 lines of just straight in the script Python code that solves your problem, that would be Python.

23:16 In say .NET, you gotta have a namespace, you gotta have a static class, you gotta have a public static void, you gotta have like all the compiling, like all that stuff, you know, it's just, it hits you right from the beginning that's there to build these major apps.

23:27 And so I think Python, one of the reasons it's so popular and bringing in people from these sort of edge cases of programming and computation is they can start really easy, but then over time, they just add a little more and a little more, and all of a sudden, they're like, "Oh, I just actually used machine learning "to study ancient manuscripts with Python, "but I'm not even a developer.

23:45 "What just happened?" What do you think about this idea, Anthony?

23:48 - Yeah, I think that's why people, like especially people who have absolutely no background in programming, like what I notice is when they look at Python, they feel they can understand it.

23:59 Whereas when they look at something like JavaScript or C or pretty much anything else, it looks difficult.

24:06 It could be the exact same, accomplish the same thing, but Python just looks more approachable.

24:11 You can kind of read it and understand what's going on.

24:14 So people love it for that.

24:15 And I think that's why so many people new to programming go with Python first.

24:19 - Right, it draws them into like, oh, hey, I can actually program in Python.

24:22 But then they grow into real programmers doing real cool stuff with scientific libraries other things or Flask or whatever and then they're kind of hooked right then they're in that space and I think that's part of the secret of Python's growth but let me go through my listicle here nonetheless so the ten reasons that they claim in this article that Python's good to learn is it's free and open source obviously nice it's popular loved and wanted hat tip to the Stack Overflow survey where they asked those exact questions who uses this who loves the technology they use and who wants to use some technology they're not and Python always ranks high there.

24:57 It has a friendly and devoted community, of course, elegant and concise syntax, not all those semicolons and curly braces and type specifications.

25:06 It's multi-platform, for most of the platforms at least.

25:10 Supports multiple programming paradigms, just like no functions straight down the script versus actual functions versus functional programming versus object-oriented programming and so on.

25:22 Has tons of libraries, built-in and third-party.

25:25 It's a general purpose programming library unlike my example with MATLAB, right?

25:29 You can do stuff in it till you hit the limit that you just can't do anything else.

25:33 And then it also integrates with other languages.

25:35 C, C++, it's got tons of integration there.

25:37 It has Rust integration.

25:39 It has .NET integration and a bunch of cool stuff like that.

25:42 So anyway, there's a bit of a take on why Python is good to learn or why people are adopting it.

25:48 All right. Well, Anthony, that does it for our main items.

25:52 We've got a couple of, a little bit of time to just talk about a few extra things.

25:56 Maybe you start first and tell us about what's going on in your world.

25:59 - I'm from prettyprinted.com and mostly the YouTube channel.

26:02 So, URLs for YouTube are a little tricky.

26:04 So if you just go to YouTube and search for Pretty Printed, you'll find my channel.

26:08 And I basically talk about Python web development there.

26:10 I occasionally talk about other topics, but it's mostly Flask and Django that I talk about there.

26:15 And then on my website, I have courses that I have available and I'm also trying to write more.

26:20 So hopefully you'll see some articles there soon as well.

26:23 So that's what I do.

26:25 And if you watch my videos, that would be great.

26:28 - Yeah, awesome.

26:28 Yeah, you're doing good work.

26:29 So I have four quick announcements, maybe three announcements and a follow up there.

26:34 So I was just a guest on the .NET Rocks podcast talking about Python for the .NET developer.

26:40 So if people are into .NET and they want to hear what does the world of Python look like from that perspective, maybe you're working at a company mostly it's a .NET shop, but you really love Python, right, check that out, share that with your coworkers about why they should maybe pay a little more attention.

26:56 So I got a link to that episode that just came out yesterday.

26:59 I got a link to that in the show notes.

27:01 And then I also kind of tied together with that these sort of one precipitated the other is I've just released a new nine hour course called Python for the .NET Developer.

27:10 So the goal is to help all these .NET people take their skills like they know how to talk to databases using any framework or create websites using ASP.NET, like recreate all of that, take those examples and then recreate them in Flask or SQLAlchemy or so on.

27:24 So that's a really fun course if you're into the .NET space.

27:27 Also have another course, Python for Decision Makers.

27:30 Like if you're thinking about whether Python makes sense for your organization or your team, check that out as well.

27:35 Links to all those are in the show notes.

27:37 And then finally, a couple episodes ago, I was talking to Brian saying, one of the reasons I call my virtual environment folder, V-E-E-N-V is it doesn't show up in Finder.

27:48 And when I'm cruising through Finder and I get to one of my courses or one of my old projects, I wanna be able to just look really quickly, say, does this have a virtual environment or do I need to hop over to the terminal and create one real quick?

27:59 And by default, if it's .env, which many times it has been, it's hidden.

28:04 You don't know, you've gotta go in there and go into the terminal and just find out.

28:08 It's not hard, but it's not like immediately obvious.

28:10 It requires a little step, right?

28:12 So many people, too many to name, I mean, many people sent me this message, which kind of blew my mind.

28:17 It said, if you're in Finder, and you want to see hidden files, you hit Command + Shift + Dot, and it will refresh with all the hidden files.

28:25 So you see your dot files, and your dot folders and whatnot.

28:28 Did you know about this, Anthony?

28:29 - I did not, because I do not use Mac.

28:31 (laughing)

28:32 - Right, so this is not a problem that you have, right?

28:34 What do you use, Windows?

28:35 - Yes, Windows.

28:36 - Yeah, cool.

28:37 - And I use the Linux subsystem.

28:38 - Nice.

28:39 Yeah, and in Windows, this is more of a setting, right?

28:41 You set in the file explorer, say I would like to see hidden files or not see hidden files but in Mac there's no such setting so apparently it's a hotkey. All right well that's all my announcements as well. We always close this out at the end with a joke so are you ready for a joke? By the way I also would like to point out that they're not always funny but we always try. Okay I'm ready. All right so here speaking of different languages and all that here's a failed pickup line so this girl's hanging out with her friends at a bar or just hanging around and some guys like "Wow, I'd really like to meet her. Maybe I could come up and say something clever.

29:16 She looks like she might be a programmer. Maybe I'll say some computer thing." Comes up and he says, you know, maybe he's been watching too much of Jerry McGuire.

29:24 He's like, "You're the semicolon to my line of code." She responds, "Get out of your creep. I code in Python." [laughter]

29:31 You know, that might be the reason number 11 to learn Python.

29:34 Yes, exactly.

29:35 You can come up with better pickup lines.

29:36 Exactly. You don't have to take that semicolon thing.

29:39 [laughter]

29:40 Yeah, it's pretty funny. All right.

29:42 Well, Anthony, thank you for filling in for Brian and being here today.

29:45 It was great to spend some time with you and talk about these ideas.

29:48 And thanks for having me here.

29:49 You bet.

29:50 Bye.

29:51 Bye.

29:52 Thank you for listening to Python Bytes.

29:53 Follow the show on Twitter via @pythonbytes.

29:54 That's Python Bytes as in B-Y-T-E-S.

29:58 And get the full show notes at pythonbytes.fm.

30:01 If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

30:06 We're always on the lookout for sharing something cool.

30:08 On behalf of myself and Brian Okken, this is Michael Kennedy.

30:11 Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page