Welcome to the real python podcast. This is episode two hundred twenty seven. Have you wanted the flexibility of f strings but need safety checks in place? What if you could have differing evaluation for logging or avoiding injection attacks?
Christopher deaf is back on the show this week, bringing another batch of py colter's weekly articles and projects. We discuss a set of recent python enhancement ment proposals, or peps. The idea of templates strings has been under consideration for a while, and pet seven fifty describes a new way forward. Pet 70 nine proposes away for projects on P P I dot org to safely host resources on external sites using a new package upload format called a dot rimm file。
We share several other articles and projects for the python community, including what didn't make the headlines about python 3 thirteen, solving sudoku with python packaging, what is sweet about python syntactic sugar database generated columns using sequence light and jane, a discussion about mentally and adaptive websters pers and a debugging tool for H T T P S. Client request. This episode is brought you by century fix application issues before they become downtime with century error and performance monitoring for python. All right, let's get started.
The real python podcast is a weekly conversation about using python in the real world. My name is Christa bai, your host. Each week, we feature interviews with experts in the community and discussions about the topics, articles and courses found at real python dot com. After the podcast, join us and learn real world python skills with the community of experts a real python 点 com a Christopher, welcome back.
Always nice to be here.
right? So we ve got a little bit of news, right?
Yeah, just a tiny little peace. And in fact, this one popped up just a couple lovers after we recorded two weeks ago. Python three one four alpha one is out.
So you three thirteen is barely out the door and three fourteen is now a thing. So it's time to try your python pie. I'm predicting at least three hundred and fourteen pie and mapped puns between now and the release in october of twenty twenty five. So what get used to IT.
Yeah, it's a requirement. What where that gets us ready into our topics this week. And we have been featured a variety of articles and things from our friend at bike code and the newsletter slash blog there.
Last year, we talked about what didn't make the headlines in python three twelve. And so now bike out has a what didn't make the headlines in python three thirteen. So a handful of things.
There was a very gracious mention that if you would like to see the things that are the headlines that you might go and check out the real python article that was done by you on or so. And I link in there for us there. So thanks.
They start out with features to improve p db, which I know we talked just brief ly about their feature. You are entering immediate with break point that fixing a bunch of kind of issues as far as working with the debugger. But there's a lot of other goodness included.
Also, a lot of the rapper changes are now in P D B. Also the multi line editing co completion, accepting dated path support for P D B in zip APP. So a butcher stuff in P D B and by code argues that this is a very good reason alone. tough.
Great to 3 thirteen。 They mentioned some stuff about as a util file system Operation updates. I know that we come dug into a little bit in our overview, things working in a more recent ve manner.
So stuff that he didn't hear about concurrency updates to how civil L A sink I O methods Operate in an increase in the multi processing pool max number of workers. So i'll like to dig into there. I really like how they are connecting to much of the original documentation, as I try to do in my show note.
But here there are so many little changes that you can go and dig into, the documentation, or the messes, threats, or the arab changes, and and so forth, if you want to learn little bit more and drill into them. He mentioned a few disappointments, performance not being a big change in this version, which we talked about a little bit ourselves, that they're really kind of lying in the groundwork for other possibilities with the git and the guilt removal, if you want to experiment out around with that. We talked about the garbage collector and things that happened there and that change being reverted.
They mentioned a few things that are, at the time, broken. I feel like a lot of those things may be fixed in the next couple of updates. And then they had a few sort of nice little random things, the V E N V command, if you do python dash and then and adds a not get ignore file, which I thinks it's kind of cool.
And so automatically ignoring the vm, which is nice, the virtual environment is most wrap up to check out. So I wanted to include with that an article that came out shortly after that, which is kind of a wrap up for october title. What's up? Python three thirteen is out.
Tea strings look awesome and debt groups come in handy. So again, kind of a bit of a wrap up thing. And so they mentioned the three thirteen stuff that we've ready dug into and then the tempt strings proposal, which is at seven fifty and all include a link to that.
It's very detailed. It's actually one of things i'm impressed with in the peculation of and providing lots of different manually like you know where we are, where we're going. Here are examples of how to use IT and so forth.
This APP has been a long time coming. This idea of how can we gets some of the functionality of f strings that people like so much, but be able to do that with templating, which is still being done other ways. And I guess people going to maybe call them tea strings, text strings, and probably the easiest way to think about them, maybe right away, as f strings are evaluated immediately or eager.
We talk a lot about this in the data frame world, this eager evaluation versus lazy evaluation. And tea strings would be on the other side of that would allow for a lazy evaluated string, which in a lot of circumstances that needed. And so they give examples in this defer devaluation would be great for translation of a document or logging or escaping out things and avoiding injection attacks like equal and showered js injection.
I'm impressed with that. That is should be an interesting thing to kind of watch that space. And the other pet that is mentioned in there is pet seven fifty nine, which is about external wheel hosting.
It's not so much about three party pipi instances or private indexes, but is more about having a custom spot or download like kind of a link on pipi. So that projects that host really large libraries, something over like maybe one hundred megabit per library or ten gigabit per project, could potentially link out to that information and not really crush P P. I with the band with cost of having to host all those types of things.
This is that docker zone of some projects that are these huge projects. It's interesting idea that they have A A new term ford of a farma that they're calling a dot R I M or rim file remote installation metadata, which is basically like a real file with all the python code is removed and then an external hosting j on file telling you where to find the real code. Neither of these pets are accepted.
Their kind of still in discussion mode, if you will, our links there, not only to the peps describing what's going on, but also then a link to the discussion actually one more pep, pep seven thirty five, which I think we may be touch on briefly the dependency groups in hype project tomo. I just did a review of, of course, this can be coming up soon on repeat on about poetry. And this seems to be maybe lifted a little bit, at least inspired by how poetry does this.
It's when you're wanting to set up a project and you want to have resources that aren't should be installed for everybody. They are like maybe development dependencies or testing tools and so forth. You can declare those things and provides ways to such structure that tabular we have doing stuff.
These tables that are done inside of a py project como. And the last thing that mentioned in this article, news wise, is my pie one at twelve supporting new generic in tax. And this is a typing change that happen in a python three twelve that you might remember.
There's a good refresh er there if you're interested. My pie supporting IT is nice kind of moving forward. Thanks again, bite code for this nice news wrap up. I can get a reference here and again, I really appreciate all the links to much more details if you're interested.
There's been a lot of work ongoing with the temples and text stuff. So if you happen to have gone through the pep a few weeks ago, you can go through the pet again because they almost three wrote IT. There's been a lot of discussion on IT, so they just stood a massive commit a few days ago updating the pet with some any idea. So it's very much something in flux, but IT looks like it's starting to settle down.
Well, that would be nice, you know, because everybody wanting to have that sort of formatted string feature for something like logging or these other situations have had to use the other format. And so idea of just changing IT to a tea in in front of your your format is string to people to get this evaluation is going to help. At least people will be familiar with this in tax and how long that stuff kind of line up.
Yeah, no, I I, I agree. I think it's a good idea. Some of the stuff in the original al pet maybe sort of go and then they got rid of all the stuff that made me cringe.
So okay, good. We're going to a reasonable place. excEllent.
Fixed application issues before they become downtime with century error and performance monitoring for python, whether your timing python processing power or controlling java script ts flow through no js backend infrastructures are as complex as they are valuable. With century, you can trace issues from the front end to the back end, detecting slow and broken code to fixed what's broken faster within minutes.
After installing century software, teams are able to trace python issues back to poor performing A P, I calls, as well as surface all related code errors. The fix was broken faster. One engineering leader that use century said the time to resolve errors went from days to minutes.
Installing is easy, and new users get three full months of the team plan free with the code. Real python on sign up. That's real python with no space. Learn more at century dot I O. So what we got for you first.
i've got a quick one. It's a little odd but interesting because it's old yeah so it's a post by Simon Wilson talking about a new package from a developer who goes by constant spelt K O N S T I on github. They used package management tools to implement as a docu soa.
So how this works is you create a text file that represents a studio puzzle. Uh, you can do this in three different ways. Uh, way number one is to create a csb file.
So for example, for a nine by nine, there would be nine lines in the CSV, and each line is a come separated value with a number for cells that have numbers in IT and and underscore for those cells that are the ones you're trying to figure out in the puzzle. You can then use a strip that comes in a package called csb to requirements, which converts the CSV into a requirement. Start T X T file, which leads me to way number two, which is you can skip way number one and just specify the requirement.
Start T, X, T file yourself so how the requirements file looks is each cell that has a number gets specified as a package names to do underscore roll underscore column. So if you're trying to put five in rose seven column two, that gets represented in requirements of txt t as to co underscore six underscore one double equals five, so roman column specifies or zero index, so hence rose seven becomes six. And then the third format is you can also use a pie project got tommo's ile with the dependences list filled in using the same format that I just described in requirements of T, X, T.
So once you've specified what your board looks like, you run pip compile, or if you're using U, V, you do U, V pip compile and output IT to a new resulting requirements file. And IT requires some other command line flags, but i'll skip that because reading note command lines in pod casters a look right? yeah.
And the end result is essentially a solved board. Using that same to do to row column equals thing that I talk about. There's also a script in the package called render solution that takes that requirements.
Violence bits IT out as a CSV, so you can go full circle and read out what that looks like. All of this, of course, begs the question as to why, but let's just go with why not as the answer. And if you're interested in what kind of things you can do to hook the project management tools, well, IT turns out it's a full programing language. And you can do anything you can do in a programing language is part of your compiled step. And so this kind of shows you that that's possible.
IT also showed .
me that I don't know how to spell to do ku. I think I spelt at three different ways in two sentences. But besides that, know that?
Yes, I just correcting some of IT in the article here in the this is summary, can always remember the oh is in the middle yeah, that one's kind of harder sudoku yeah my next one that I had bread cannon on the show a few times back in epo de forty seven, we talked about unravelling python syntax to its core. And then mac, in episode ninety two, he came back to kind of continue on aveling python syntactic shorter.
And so when I saw that layer on a poser, ramos had written an article that was very specifically about syntactic sugar, why python is sweet and python ic. I decided, okay, well, I might be kind of fun to cover. It's very much a listing of all the different ways that python uses synthetic sugar across the language and different techniques and so forth.
And I think that might be a really good guide for someone coming from another language and looks at python and goes, okay, well, what is all the funky stuff that's going outside of the what what is the different formats of these systems and how is that laid out and so forth? If you're not familiar with the concept of syntactic sugar, these are pieces of code or the syntax of the language, and there meant to certain simplify IT, in some ways make IT more readable, in other ways make IT more conscious. Most languages do this.
I feel like there are obvious changes that most languages do like. Let's use the plus bol ARM to indicate addition. In the case of python, light on us goes into the very, very detailed stuff that's actually happening under the hood. This is where you need to get finger on the trigger here, Christopher. Her, everything in python is an object.
Thanks for the warning. I was happy sleep.
So there are special methods that are implemented to do this stuff. So in the case of of the plus sign, there is a special method dunder ad that happens there and so forth. And so by default, when you create your own classes that something that's not there, you know you would need to actually implement that to have that.
So this kind of gets into that a little bit, and you can understand a little bit about the building of the language, but also a little bit of building of objects and so forth. How does my thon use this? That takes you through each of the constructs in sin tax Operators, starting with that.
Those are like the plus, the minus, all the typical stuff for like, okay, how do you do division? And then we get into conditioners like greater than, greater than equals, a few of these things. I definitely had that question when I first started learning python, and I really wanted to do video and teach these kinds of concepts because I felt IT would really help me learn them.
And so one of the big ones in my kiss was decorators, but also f strings. You going back to that, like, I didn't quite understand what is this syntax and how does this work. And so that was a very early one that I wanted learn.
So I did a course about estranged, that, of course, about decorators using the assemble and kind of how that works. So that helps me understand them more, and you might have your own like another one that was odd to me also was unpacking the the asteroids that was used for things like unpacking a set of arguments. Uh, you might see the common structure of A R, G, S arms and then K W A R G S or keyword arguments.
I still like calling them arms and cards, but you might see the star there, or the double star for that. So this article really digs into all that stuff, areas of interest that are going to be different for each person. You might be like, okay, well, what is this thing called yield? And how that work with a generator? And what is the with statement? And so a little good tour of that stuff.
What bread was trying to do is slightly different. He really wanted to know more about breaking the syntex down to what are the core elements make up python and its language in his series that he did on his blog. And partly why he wanted to do that was he wanted to know, like, what is the minimal viable language components that all the other constructs in python are made out of.
And partly why he want to do that was he was looking at the assembly and making a small version of python that could be implemented in. And so that kind of goes back into the idea, like, what's there? He created presentation, this sort of summarize all the stuff presented back at pike, cades and python.
And I could a link to the video, probably the pon one. You can also listen to my conversations. You've gone back in the past and listen to are my previous things. We talk about the web assembly wom in paradise and most recently, the episode that just came out a week ago, talk quite a bit about this with pie etes and how that's being implemented and paradise and now micro python, which is again, that really kind of the idea of that, like how can get a just this core elements of python and then run them in the browser?
So I have two questions for you ahead. One, should we add a sound for every time somebody is something about typing and pithy and given its my soundboard can not .
be something negative and two and two, more importantly.
is there a piece of syntactic sugar that you like a lot or couldn't live without?
So right now, I definitely all the standard Operators that's like a note like that kind of have to be there like plus minus to me, like I would really not like to have to write them. And you can see in the article how this is done. You would you take up a number and then you'd say inferences sees dot dunder ad you, whatever.
And I feel like that would be rather confusing and can slow. But decorators are one of my favorite constructs in python. And now that I understand them, I don't think I would want to go back. And if strings or another one as far as IT goes, I don't know that quite fits entirely this and tactic sugar thing.
but um yeah is the same of the Operators like the Operators are syntactic sugar in python because they're designed them to be that way. They're not in a lot of other languages. So they they could have made the language choice to have plus and just be plus. IT didn't have to be because of .
the a word objects. Yeah.
I think for me it's probably the the with in the .
context manager text.
It's one of those things that has, i've remembred discovering and other programing languages, you know, using constructors and the constructors in order to automatically clean things up, because it's so easy to forget to do something like close the file, right? Yeah, yeah. And this just makes that so much cleaner and easier and and it's easier to read, but IT also make your code more bulletproof, which to me is, but that's a great plus. That's the right choice, right? Like that helps you know you're making the right choice.
Yeah I mean, IT does so much. It's very interesting. I mean, decor ATS are kind of similar in the way that there's like this whole like sort of set up phase, tear down phase that is so behind the scenes now, which is really nice.
It's nice on the language is well, I think you said already earlier this idea of like can we minimize the amount of things that you you need to type, but in this case also you protect the the users from making dumb mistakes, I guess. So so, so well, I think it's a good resource. I don't know how easy is to read through persue. There's a few those resources that we create sometimes on real python where they cover so much. And so it's one of things I think you maybe come back and forth to IT.
I think that works is a good springboard. And like, oh, yes, I didn't realize that way. I'll go dig to find something SE.
And he can include the deeper resources on almost every one of them, which was nice. So if you're like, okay, I think I kind of a get what there is being explained here in this paragraph as I OK. Well, here's an entire tutorial that goes much deeper into IT, which is right kind of like what real python's all about, which is, uh, again, a good resource. So what's your next one?
I've got an article by hello a mile and it's titled database generated columns jane and SQL light. It's a little over year old now and it's talking about the future. They're got added in.
Gentle five year old are already on five one. But it's a really good intro to this feature. And IT made me go from why do I need this to hey, this is a bad idea.
Thank you, sir. So first off, just a quick reminder about the jingle O R M. Inside your code, you write a class with fields to describe what you want in the database. Jangle then creates appropriate tables and columns based on your class decoration.
So for example, if a person class with the first in the last name, I specified two fields as attributes on the class, both of which use the chart field dango class, which means they are going to be stored as characters, hence the chart and jungle then create a table for that person with three columns, number for an I, D, which is automatic, and then one for each of the first and last names. Different database have different courts. So janoo attempts to abstract this away from you, and you just does this underneath for you.
So jingo ships with all sorts of different fields, including several for text, different kinds of numbers, billions, relationships between different tables and jangle. Five added one called the generated field. And IT works as a dynamically set read only value.
So you specify a generated field by giving an expression, and that expression is what determines the contents of the column. So back to my person example. If I wanted to have a full name field consisted based on the first and last name, I could use a generated field to do that.
I shouldn't, using personal name as a horribly western ized way of storing your data, and I evenly combining them into full name just doubles down on that mistake. But that's attention to go. How to store people's names and has nothing and has nothing to do with the fields capabilities.
Uh, so anyway, uh polls article goes through several different examples of how to use this generated field, including different kinds of expressions that you can take advantage of. His first example shows a table for storing data about a rectangle near classic shape based example in programing. The rectangle class contains two float fields for the base and height of the rectangle, and then the third field is for the area, and it's a generated field.
To specify the area field, you need three things. The first is the expression, and the expression tells the database how to form the contents. Jane already has classes called f used to specify fields for other database goodness.
So this expression just uses those and multiples to f objects together, one for the base, one for the height. In addition to the expression, you also have to specify what kind of field the result is and which in this cases, also will float. And finally, there's a flag to say whether not to actually store the result into the table.
If you specify this is false, you'll get average to all column seeing your database supports that. And then for true, IT actually calculates IT and stores IT. And if you change you through the values that we calculates and changes is the third.
Uh, the latter can help if you actually want to index the column and do searches on IT, which is the real power behind this attack. But i'll come back that the second 啊, you can do far more than simple multiplication. Jangle ships with a series of databases, functions that you can use to create your expression.
Police article includes examples for power sign, coast, concatenation, ings and some data manipulation functions as well, including things like getting at content inside of the some blocks. So beyond math, you can also do conditional expressions. So you do this with a case.
And when function, combining these two allows you to check a value and conditionally change the generated field this result. So the article uses an example where checks whether one field is not know, and if so, Marks and invoice is paid. So when the day gets filled in, IT gets up to paid.
Before I wrapped up a quick word of warning, uh, although this is abstract away for you from the database, not all database handle all kinds of expressions, so this is definitely something you want to test out before you go to your boss and say, I know exactly how to solve this problem, because you might not. That being said, i've often had functions in my classes that produce these kinds of results, with the limitation being, you can't Carry on them by using a generated field. You can now push this kind of work into the database, which means it's sorted inquiry, which is kind of a superpower. So there's definitely use cases for IT and pillows articles are good introduction .
to IT that is very detailed.
Yeah, he's done dropped lots of good examples. yeah.
This week, I want to show a spot light on another real python video. Of course, a main attraction for many python developers is that it's a dynamically type language, but if you're working with user provided data or working with credentials, then data validation and managing settings will be vital for the reliability of your python projects. And that's where a tool like pynte comes in.
This course is titled using python to simplify python data validation is based on a tutorial by Harrison hofman. And in the video, of course, there and Jones takes you through working with data scheme s using pytheos base model, writing custom validators for complex use cases, validating function arguments with identical validation call and managing settings and configuring applications using pytheos settings. If you work with apps, databases, credentials, or user settings in your python projects, I think this course will be a good investment of your time.
Real python video courses are broken in the easily consumable sections and were needed include code examples for the technique shown. All lessons have a transcript, including close captions. Check out the video course.
You can find a link in the shower notes, or you can find IT using the enhance search tool on real python dot com. We did have discussion last week, but we have found one for this week. So do you want to just introduced the discussion this week? okay.
Uh, you may have heard of the jago not mentoring program. IT helps folks who want to contribute to jingo by budding them up with someone who knows the ins and out of the framework. And ryan Kelly has done two rounds of mentors for the program, and he wrote up a blog post about what that means to be both a good mentor and a good mental.
There's nothing, jane, not specific and IT, that's just kind of what h kicked IT off the idea. So he's got some advice for working with a mentor that starts off by telling you you can have to have a clear goal. And he sort of contrast this by giving three examples, the statement, I want to be a programmer versus I want to try python verses, I want to learn coding to help automate these things.
And that third one here is kind of a key that allows the mentor to give specific guidance and point you what things you can do. IT also gives a point of conversation later. So if the mentor suggests that you go watch a specific video or listen to a specific podcast, then the next time you meet, then those can be things that you can discuss.
What part did you like? What part didn't you like? You know, what did you understand? You have questions.
Ryan also recommends scheduling yourself. So mentors are giving you their time, so make sure you do the things they're suggesting. And I know this may sound simple, but show up to your meetings.
I've personally been in this situation a couple of times and IT doesn't take more than a few most meetings, especially if there is no communication following up afterwards saying goops I screwed up uh and IT doesn't take long before I put a kibosh on a mentorship because you know my time and your time and i'm giving and now all you're doing is taking anyway uh, ryan's article then goes on to give advice to the mentor as well. My favorite part here is its super important to remember it's their journey and not yours. So i've done some mentioning but i've one a fair man of coaching.
They're kind of similar things and rule number one of coaching is always make sure the person wants to be coached in that kind of the same concept, right? Like you try to figure how you can actually help them. So um what do you think yeah .
I I like IT and I like this program that jingle not doing uh if you not find another, whether when you like launch piece of you set up your jingo project that starts with this little rocket. And so I think they'd I always kept that theme going.
And so I like that idea that the jingle, not themselves, and in the idea of like trying to figure out a way to take them through this program and and maybe think about mentally generally, like already mentioned a couple of things like how much of mentally is being a coach? I think that might be the closest example. A coach doesn't necessarily.
They are not necessarily a teacher. They're not always going to take you individually step by step, by step by step. They're gonna give you things to do, exercises to do, like stuff to kind of push you in the direction and give you encouragement and answer your questions. But a teacher is going to maybe do much more of really explain the subject and you're going down to brass tax and stuff like that. And I feel like there's also this like being a therapist part that I think some people think of, like as part of the relationship.
This is really hard like yeah I can be you know and some forth I haven't been a mentor in a lot of circumstances as far as like programing, uh, I think i've helps people here and there and you have been like a co worker and you again advice and so forth. But i've never had that formal formality uh of a set up maybe partly because of workplaces. I feel like this is becoming a workplace sandwich is actually really good in some circumstances.
Um I think I can really help. I've worked as only a teacher and spector, i've worked as a consultant, which has always been an interesting one for me, where I have been hired to tell people how to set up the recording studio or maybe their home equipment to our whenever IT is. And the more frustrating ones out of those are the ones where the people just basically say, we'll just go set IT up for me, right? And to me it's like, okay, but if you don't do this, i'm going to have to answer these questions like I don't know how many times and of course, they are paying me and sometimes that's okay.
But I would rather than I rather see them progress and see them build IT up and from there. And I I feel like that's the case often with programing as A A teacher when I worked at apple for little while, as I A trainer there and I would go out of my way, you know and and stuff if they tried to stress that there, but not everybody would do IT to make sure that the person is driving the person yeah you're trying to work with has got their hands on the keyboard and the mouse and and and i've said this many times, like I always watch them do that and I feel like you could do the same in a mentorship. We've had a couple interesting brushes into this, uh you know even kind of with the show briefly like back and epsom for right when we were starting ahead.
Martin on he is starting about learning python through errors and that errors you are friends. But we got into this whole side chain thing where he was working on a program with, he had been a part of this thing called coding, no mad. And during the pandemic, they started to stay at home mentorship program.
And I remember john venture, who somebody also had on show very early on, got really involved. I got really, he had done mentor at microsoft, and so he was very interested in this idea. And I think you really, I think he might still be doing stuff with coding. No math there. And I think .
you did some also. Yeah, i've volunteer with that. I had, I took somebody under my wing for one of a Better phrase, yeah the intent behind the program was for folks who had lost their jobs.
And we're looking for typically a career change. okay. So like the the guy I was working with had some tech background, but IT was more networking type Simoni type stuff and he wanted to pick up python.
And uh, how that program worked was on their own. They we're supposed to go off and do like code academy or read real python articles or whatever they were supposed to to to go through those steps themselves. And essentially what you were doing was offering a couple hours a week of being a human being.
Cook could answer questions and provide guides of all this is you're interested in and try that area kind of thing. And IT varied from week to week, some weeks. That was, he was stuck on some things, so we'd go through and i'd like live code and say, okay, what do you think gonna happen next kind of stuff. And another week would be, you know, I tried to get him go the other way. Okay, you live code.
And okay, well, what do you what do you going to tackle mix? And how are you going to do that? right? One of things he doesn't get into the article that I find is is always kind of interesting is the there's formal versions of this and there's informal versions of this, right? So look, I have never formally been mentor yeah .
I think that's my case too.
I i've never signed up and had someone be my mentor, but my god has so much of my management will come out of the accidental mentoring is like that boss is so much Better at this than I am. I have to watch what they're doing.
right? Learn by what they've made a mistake doing.
yeah, yeah. And they spend time with me, talking to me and coaching me on, you know, what I was doing right? What I was doing wrong, but I was just never as you I ve never had deep two hours a week, we're going to have this conversation kind of thing, right, right? And I think both are useful and both are important. But I think IT also changes a little bit of how you tackle stuff.
So the advantage of the formal spaces, you can sort of kind of do that homework key stuff, and you can look at progress, right? The informal can be useful also for, I find, with soft skills, right? So like, oh, I was in that meeting with you and you know, if you'd phrase this Better, they wouldn't have started yelling, right? And that kind of stuff requires a little more to sort of to be present at events, whether the kind that rans talking about in this article, more sort of the the formalized that happens often in the code in space. Yeah.
yeah. I think that having been a musician for a large part part of my life, it's been interesting because I end up as a traveling musician. You're meeting different personalities like every spot that you go and having to figure out OK, well, how how is this going to work at this venue and how do you interact. Having been a technician on the road is a whole other thing like meeting this other staff. And and so for it's a lot what you are saying, like I feel a lot of developers, engineers will have you they get a bit of this stuff in school and maybe they get a little bit of IT in an internship, but I would love to see them do sales yeah work .
as a service .
industry person first. Little while this idea of like shadowing that we've talked to a couple times about, I think in other department, sometimes they do management. Obviously, that's a common thing where me know my wife has done a lot of that. She's been in banking and has been like a VP in the fourth, and there's a lot of that there. I feel like that's structurally but I feel I guess as a uh, person entering development later in life, I didn't get to see those is of like, well, okay, what is the mentorship program inside of an organization as far as like the whole idea of a junior senior thing I wonder about that, did did you see that sort of mentors happening within team of of developers? I I think part .
of IT is is like the dynamic of how we work together. His change, right? You go back to like nineteen, nineteen, sixty, one thousand nine hundred and seventy style management and IT was very hard article and OK modern workplaces.
There are still some of IT and people or people in their politics. Don't get me wrong. But it's much more likely that you're working on a small team and that small team has a goal and everyone is trying to figure out how to contribute that, right? The structure is flat.
yeah. And so the um the flip side of IT is, is i've seen organizations seem to be much more conscious of the idea of coaching and mentoring than they used to be. They understand that that's how you're gna grow IT. A couple of banks i've been dealing with have programs where it's like o if you're fresh cut of school the first two years, you're not going to work in five departments in that end.
And we know it's part of IT like you are going to work at this department for five or six months and then you're move on to a different department and they're very, very intentional about, okay, you're going to spend some time in retail and you're going to spend some time in commercial because those are too tirely different chunk to the bank and they do things completely differently. yeah. And so IT gives people the ability to Better understand what's going on.
I've seen a fair number of articles with companies that are talking about on boarding that it's become a very common practice to go. okay. So here's your any questions you have over the next two weeks, three weeks, whatever is start with your buddy.
And and again, that's that recognition that we're throwing you in the deep end. So yeah at least point to with some other people who are also swimming so you can know which direction to women. I think that analogy is gone off the rails, but you get the general idea.
Ah I had problem on a couple years ago, we talked about guilds inside of he rich for bloomberg. That's another area where I feel like that, that kind of entering is maybe happening with inside of a larger organization and people who are able to express interest like you know maybe you worked and be the finance area and you're interested and maybe learn a one more about programming, maybe using python. You can go check out the python garden.
Yeah, it's the formal structure of mentoring I think is interesting in venturing programs. I think you're interesting especially for something like open source for like this. Is this in some ways extra curricular lar thing to your life. You're like, I want to try to do this thing .
and in the reason the jangle is done, that is like jane is is a beast, right? Like it's a huge and some of the choices I I love you guys, but some of the choices are questionable like why don't live there and the answers history, right but if if you're starting out new and you didn't use python two thousand five and go one two, my peace scratching your head right and and having somebody who can guide you and give you a bit of that history and point you at the right places to go, you know it's it's useful.
I've got a buddy mine who's been laid off recently, so he's tinkering in the background and every once a while I get the note of, okay, what python libraries should I look up if I want to solve this problem? right? And and it's it's not quite to the level of mentorship, but it's he's he's not asking for more help in that.
But it's like, okay, I think I want a web scrape and I want to do this and I want to do that. Um okay, try this article right and there's value and being able to have that right because google IT and you'll get an one answer that there's an article for everyone. Is this one's Better or that one's Better? And IT can be very, very overwhelming, right? So being able to to tap on somebody's shoulder is this value in that?
Yeah I feel like there's so much pollution in in the space of like any kind of hobby you might want to get into. Now go. I want to do with working.
How should I start? And it's just onna be junk articles at the top of the o optimized. You're like, can I just have someone? Can you and I think the youtube is like kind of come in in some place. Of course, you got a sorry through that too. But yeah, maybe just having one person tell you.
like check out this person, yes, or what have you yes, just a way to get in the way and get you somewhere to go from yeah.
Well, I think IT takes us in the projects speaking a web scraping, which you just mentioned briefly there. I have a web scrapper, which is one of those things I like to talk about from time to time. And this was called, I think it's pronounced scraping instead of scraping, but their subtitle is lightning fast adaptive web scraping for python.
This projects by cream chorea and they go by d four vincey on get 他。 The other sort of sub sub heading is dealing with fAiling web scrapers due to website changes, meat scraping. And so one of the ideas here is that you've set up this elaborate scrapper, and it's like maybe brunning on a schedule to grab sport scores or do some kind of interesting thing, and then that website changes their structure.
And I got a lot of work I have yourself and how to fix this. The idea is that this could automatically adapt to that and find the same elements that it's been searching for. The past is very interesting.
This is one of projects are right away. IT worked. I love that I was the pip install, get IT working and play around with the examples.
And that was actually really nice. IT is a very smart navigation system where IT really does the idea of trees, parent, children, siblings. We also can do C, S, S.
Selectors and classes. So they talk about the speed so often in this thing. And they gave, like, lots of church.
They pick on beautiful soup, which is you kind of a bit of an older library. This is definitely much, much speed here. As far as like how IT works inside of there, i'm intrigued.
The auto matching feature has some similarities to you use something like scrappy, which i've used to describe things off aside and pulled things out. IT has some I want to play with a little bit more. I didn't have an example to play with scrupling.
So which is my project this weeks called H T P D bug, spelt H T T P D B G. And it's by user club. I don't know how to pronounce that.
Sure b with .
hypos in capitalizations. So how much what you supposed to do with that anyways when you've got code that interacts with a server through A C T P S because of the encysted, which Normally is good, that means you can easily see what's going on inside. And what this tool does is essentially provide you a man in middle attack that allows you to see what's going on.
So the easiest way to use IT is on the command line as a substitute for the python interpreter. So say, you've got a strip that uses something like requests to go grab a page. I guess we're on that theme today, aren't we? Now we are.
Yeah, you can instead call that script using pi H, T, P, D, B, G that comes with the package. And once that h interpreter is running, IT also hosts a web page, you that on your local machine on port forty nine time, so you can open up your browser and look at IT. And IT contains all the information about the calls that went through.
So you can respect you can look at the heart request responses, cookies, all those kinds of good things. And IT also displays exception and stack information if if your code falls over. People tell me this happens if i've never seen IT myself.
But and it's kind of like a light weight version of a networking tool. But because you're in full control on your box, you can essentially get around the encryption. There's also hooks for test codes.
So if instead you want to run a bunch of your tests instead of a script, it'll do that as well and got some other pieces for pie teston things as well. So Normally, encrypt is a good thing, but I can make debugging a pain. So tall like this one can be very useful.
yes.
And just before we go, I just want to remind people that we're always looking for projects to show out a boat. Will you include a link to have you submit off the pie cotters? We're always looking for good stuff.
I go through fitz and sports where it's like, oh, there is plenty of good things and i've got a bunch stuff cute in the last couple of weeks. It's been very little. So if you're interested, there's that IT might be easier to get in the list right now because I don't have a big long back. Ye, so was made stuff to us.
Yeah again, we feature all the stuff from the py quoters newsletters. There are links. There are included a national link here for you to submit stuff.
But you can definitely check IT out in the newsletter and all the stuff that we cover. And I got another minor request we love when you review our podcast. Please do that on your favorite service.
We love when you give us a good review. Yes, yes.
all right. Well, Chris, thanks again for bringing all these articles and projects in topics this week. See in a couple weeks. All right.
And forget, installing century is easy, and new users get three full months of the team plan free with the code. Real python on sign. I want to think Christopher r.
Trudeau for coming on the show again, and I want to thank you for listening to the real python podcast. Make sure that you took that follow button in your podcast player, and if you see a subscribe button somewhere, remember that the real python podcast is free. If you like the show, please leave us a review.
You could find show notes with links to all the topics we spoke about inside your podcast player or at real python outcome slash podcast. And while you're there, you can leave us a question or a topic idea. I've been your host, Christopher fAiling, and look forward to talking to you soon.