Hello and welcome to Python Bytes. This is episode 231, recorded April 28th. Is that right? Yeah. 2021. I'm Brian Okken.
I'm Michael Kennedy.
I'm Cecil Phillip.
Yay.
Hey, welcome Cecil.
Hey, thanks for having me on. It's always good to come back on this podcast. This, you know, unbiasedly is probably one of my favorite podcasts to listen to, to be honest with you.
Mine too. Yeah.
Thanks so much.
We get to learn so much stuff by studying and just getting ready for each week. And it's always fun to just see like the new and exciting. Like developers, we love the shiny new things, right?
Yeah.
Absolutely. Well, before we jump into the topic, I thought maybe we could let Cecil introduce himself real quick. I know you've been on the show before, but it's been a little while.
Yeah, it has been a little while since I've been on. But hi, everyone. I'm Cecil Phillip. I'm a cloud advocate at Microsoft.
And that pretty much just means I spent a lot of time in the community working with, you know, different companies and students and, you know, just really creating content around how, you know, how developers can start using our tools.
One of the things that I do, Michael's showing you, you know, one of the pages from our Channel 9 video site. I help run the on.net show.
It's not Python, but it is .NET and we do talk about, you know, just a lot of different things in the ecosystem.
So about-
You also do Python stuff on some live stream on Twitch and so on, right? Just not on the official .NET channel?
Yeah, yeah, yeah. So we do do, the live streaming stuff happens on Twitch and YouTube. And, you know, you could always go back and check out like the, you know, the recordings of those tools.
Really quickly, before we jump to Brian's item, I do want to point out on the screen that's top level statements that C# has added, which is like, let's be more like Python.
I just think that's kind of an interesting thing, right?
I think with the last set of, like in C# 9, a lot of the things that came out of the last language feature set, everyone is just like, this looks a lot like Python.
This looks a lot like Python.
Wait till .NET 6 and C# 10 come out, then I'll have to see what you say there.
We're going to use the def keyword and all that. Typing's optional.
Got it.
I mean, I don't know. We'll see. We'll see what happens.
So I might have to check out C# again if it gets close to Python.
I mean, it's not a bad sign to jump in.
Yeah. Yeah. Definitely one of the better languages out there. I certainly think so.
All right, Brian, take us away. What's your first item here?
Are you going to tell us or else what?
Yeah. Or else.
So I actually was intrigued by this because this is, it's an article called the basic, well, what's the article called?
For else, a weird but useful feature in Python.
Plus there's a cute avocado stuffy.
But there's, I'm not used to using else or break in my Python code.
I just don't do it that much.
So the, yes, hello birds.
So the, this is an interesting,
interesting article about,
about the else block.
And what it does is if you've got a for loop and you,
there's no break inside of it,
well, then your else will get hit.
So the only way to use a else effectively is to maybe have a break so that you,
at some times don't hit it.
So it's still a little confusing to me.
So I was reading more.
The, the article goes on about talking about some examples where you'd want to do it.
And, and it does explain, it explains it way better than I just did.
So if you're interested about that, read the article.
But the explanation of why you would use it.
My favorite is if you were going to iterate to find an item.
And you would normally maybe use a found flag or something to say that you found it.
You don't need to with this.
You can, you can, once you find the item,
you can break.
And then the, and then you'll hop out and the else block will only get run if you did not find the item.
So that's really pretty much the use case that I think is neat.
Yeah, I agree with that one.
And I love the break out of these loops early, you know,
because we end up so often with super indented code, right?
It's like, if this is true and if this is true and if this is true,
and you could put those into a couple of breaks or continues in your loop.
And then, oh boy, it's nice and flat ish.
Yeah.
The, the other, one of the other use cases he brought up was,
was using it with an exception.
So if, if you've got an exception, try except block within a for loop.
And, and you kind of want to know outside whether or not any exceptions were caught.
You can use the else block to find out if you, if any of the exceptions.
Man, I can't get behind that.
Like, I know that's the use case.
Try this else.
I can't get behind it.
I, it's just, it's too, it's too weird for me to think about.
I, I would, I just never use it because it just seems a little unusual.
And I know I've talked with some folks on the internet.
They're like, oh, but this is a way to add like a continuation to your try block that you
won't overcatch errors.
And I'm, yeah, I don't know.
I hear you.
But I, but this, this else one on the loop, I could, I can see this as a, you know,
not too bad compared to found flag.
And then what I want to express before we leave this is if you're going to either put
a, I think both break or else, if that's in your code, there should be a comment explaining
what it does because there's a lot of Python developers that won't know what's going on.
So.
Yeah.
So what do you think?
Yeah.
I, I actually really like both of them, like both the four, the four else and the, the
try else only because I think about how much code would I have had to have written otherwise.
You know what I mean?
Yeah.
For me, it just kind of makes those situations a little bit more succinct.
And I completely understand what you're saying because a part of me also on the other half
is like, well, I could just put the rest of the code inside the try block.
Right.
And then, you know, obviously there's no exception.
We'll just keep running on.
Exactly.
Yeah.
Like my continuation happens in the same block of code.
So I completely understand it from that perspective too.
So I don't know.
I guess I'm kind of 50, 50 on it.
I kind of like it.
I kind of, I'm like, well, we could do it another way.
So I don't know.
Yeah.
And just jumping back a tiny bit.
That's all.
Dean has a bit of foreshadowing for you in the live stream.
John posted in 2022, looking for Pi Sharp developers with 10 years of experience.
Wow.
And Rob is out there giving a shout out to Brian's birds.
I don't know how accurate that emoji is, but it looks pretty legit.
That's pretty good.
Yeah.
We got, I got three here.
Nice.
All right.
I think I got the next one, right?
So let's talk.
You were done with this one, right?
And I didn't steal it from you.
Yeah.
And I'm going to, I'm going to step out and cover the birds.
So.
Okay.
Well, I'll tell you about the ORM while we're doing that.
So probably the two most popular ORMs we have out there are Django ORM.
And if you're, which really only makes sense if you're actually doing Django or SQLAlchemy.
And those are both really interesting, but I want to give a shout out to Tortoise ORM.
I think these names are always interesting.
Like naming things is hard.
I always think of databases and database libraries to be awesome if they're fast.
Yeah.
The less awesome if they're slow.
But Tortoise doesn't scream speedy.
But I think you should think of it more in the speedy side because it's primarily an asyncio object relational mapper inspired by Django.
So if you were like, I love what Django does, but what I really want is an async version of that.
Tortoise ORM is a really good example.
And, you know, it uses the active record design pattern instead of unit of work, which SQLAlchemy uses.
So it's pretty neat.
They have a bunch of performance stuff.
And I really like that they show performance against many different ORMs, not just Django and SQLAlchemy, but other ones like Pony and Kiwi and a lot of different use cases.
You can get a sense.
Like it's pretty fast.
It's not raging fast, but it's async.
So that's a really, really good option there.
Super simple to use.
When you install it, you typically need to install the underlying database driver that it's going to use.
So if you're going to use it with Postgres, you install asyncpg.
If you're going to use it with MySQL, you install AIO, MySQL, and so on along with it.
But if you look at the code, it's super simple.
And if you're familiar with Django, you go and create the fields as members of a class equal to some descriptor like fields.intfield or field.textfield.
Set them have indexes and so on.
What's really nice is there's like really good modeling of relationships.
So there's like fields.foreignkeyfield, fields.mini2misfield, and it talks about the relations and so on.
So yeah, this is a really nice RM.
If you're looking for something async that is like Django, give this a shot.
It's pretty popular.
It has almost 2,000 GitHub stars.
It was updated two days ago.
So yeah, it seems like a nice, happy project.
This looks pretty cool.
When you were showing that installation section just now, so you still have to install like the async versions of, I guess, that particular database's driver.
So async MySQL, async Postgres, and things of that nature.
So I'm guessing what this adds, kind of like what you said, is that active record programming model.
So if you want to write your code in that style, you know what I mean?
I can write it and then now I could just switch, swap out the database driver and I could point to a different database implementation if I wanted to.
Yeah, exactly.
I think it does two things.
One is there's always like database dialects, like how do you express parameters?
Question mark or at parameter name or whatever, right?
I think it handles that.
And then a lot of those drivers, they're async, but they only work in raw SQL.
So select star from such and such and so on.
And so this just gives you the ORM wrapper on top of it.
But I think it does this dependency thing because otherwise it would have to install like every driver it supports.
Sure.
And, you know, that would be a hassle, right?
Because you only want one.
Yeah, that would be a little messy.
Yeah.
Why does it take so long to install?
Well, it's installing every database driver it can think of.
No, this is pretty cool.
I like it.
Brian, what do you think?
Actually, I think it's pretty great.
And I was actually starting to look at an ORM for a new project.
So I might check this out.
Yeah, I like it pretty well.
It's got some really simple ways to program it.
You can create one of these objects and then you just await tournament.save.
If it's a tournament in this case, or it has like a factory sort of create method for queries.
You go do some kind of query, then just await a class.filter type of thing.
And it even does like the join.
So you don't end up with the N plus one performance problems.
One thing I guess I would throw out there is it seems to me like this is 100% async.
So if you're going to use it, you have to create an event loop and just run it in there.
And if your app is not very asyncy, then it might be kind of a hassle to use.
I'm not totally sure about that.
It used to be that there were these wrappers you could get that would take non-async libraries and database libraries and stuff and make them async by putting them on threads.
I can see a world where we get back to wrappers that make them sync so they're easier to use if you don't want to do async.
Yeah.
I know one of the things for me that's always been a little challenging is when you have like these async database things, like how do I test them?
You know what I mean?
I always find like testing, at least when it comes to unit testing, testing asyncio things is relatively non-trivial.
You know what I mean?
Yeah.
Like I have a thing that uses motor, like so the MongoDB async library, and I'm using it in FastAPI.
And, you know, FastAPI does this injection thing.
I'm like, oh, great.
My code is clean because I'm, you know, I'm separating concerns and I'm doing all this thing.
Man, like how do I test this thing?
Like how do I...
Brian, do you got any advice on testing async things?
Well, I don't right now, but I think that'd be a great topic to explore and try to get some people on the podcast.
Yeah.
Yeah, I agree.
Yeah, that'd be great.
If you ever write like part two of your book, I'd love to see it.
Well, there's a second edition coming out, but it doesn't include async.
It hasn't published yet, has it?
There's still time for another chapter.
There you go.
Jumping back, I did see that Brett Cannon had an interesting...
comment about the else clause.
One of the benefits is that...
Hey, Brett.
Makes you look like a Python expert in code reviews when you suggest people use it.
So...
I think that's funny.
Yeah, that is funny.
Yeah, a lot of thoughts here on the else clause.
I do think it's one of these things.
It's a little unusual.
Like a lot of languages have like, oh, we all have the while loop.
We all have the for loop.
We all have the statements.
They all look like this.
And this is kind of a little bit different.
So it's kind of interesting.
All right.
Cool.
Cecil, you're up next, right?
Yeah, I am.
So I ran into this post about faster Python with Go shared objects, which I thought was
a really interesting read.
Mainly for me, I'm really into like language interrupt, right?
Like the fast part is cool and I get it.
Like fast is always a relative thing that we could consider.
What do we really consider to be fast or not?
But, you know, it's always interesting for me to see how we can take one language and
another and kind of plug them together.
You know what I mean?
Because I'm a big believer in let's, you know, let the thing do what it's best at.
You know what I mean?
Like, so for instance, Python is really good at doing certain things.
Let Python do that.
Or Go is really good at doing certain things.
Let Go do that.
But now how do we plug these worlds together?
And so this article kind of goes through talking about how, you know, within Go, you can create
these things called shared libraries.
And I believe what it does is that it outputs a .so file or a .dl file.
Yeah.
And then based on that in Python, you could use something like ctypes or this article actually
even references something called cffi.
I've never heard about cffi.
I don't know if y'all have spoken about it before.
Yeah, it's a more modern interop layer between c libraries.
Yeah, I think they mentioned it as well.
Yeah, yeah, right there.
Yeah.
So it mentions using things like cffi, for instance, to be able to load some of these
files and do interop, which I think is actually pretty cool.
You know, it does also talk about some of the pros and cons, which I think are very important
to discuss.
So for instance, this says, well, it's really good if you're just passing around like primitive
types.
But now when you want to pass around like more complex types, like, you know, dictionaries
and classes and things of that nature, then it becomes a little bit more tricky to do.
But, you know, again, just in terms of, hey, I have this thing.
I want to pass on to go to maybe, I don't know, maybe go runs it in the background or,
you know, runs this microservice thing that, you know, does Docker and Kubernetes or whatever
the case is.
You know, we could leverage both ecosystems to, again, have them do what they're good at
and kind of like just plug them together, which I think is a pretty cool read.
I'd love to hear what folks think about it after they read through it.
Yeah, I think it looks really interesting.
You know, one of the powers of Python is this interoperability, mostly around C, but also
other things like weird things like Fortran and so on, right?
Like people say, oh, well, doing math with Python is super slow relative to C++ or whatever.
And yet data science is so popular where it's almost all math, right?
How do you square these two things?
Like, how do you make them work?
And it's because a lot of that gets pushed down into some more native layer, like a C layer.
You just hand off the data and then zip it.
The real work happens there.
And this seems like another really cool way to do that, right?
Something that works really well in Go, write a package, wrap up the Go bits, put them in a wheel,
hip install them, and people don't have to know.
It's also not just what the language can do best.
It's what the developers can do best.
And if you've got somebody that's really good at Go working on part of the problem,
being able to connect them together is a good idea.
I think that we're far away from the time where people just had one language that they knew anyway.
And I don't know if we ever were there.
But definitely, you know, early in my career, there were some C and C++ developers that that's all they knew.
A little shell scripting.
But I don't find that anymore.
And I think most Python developers know some other language as well.
Yeah, like CSS.
They typically program in CSS.
That's just the bad.
That's what the bad surveys ask.
No, but you're right.
And it's also not just about knowing the language.
It's about, well, we spent two years building this other library and it works.
Can we just use that over here?
Like this interop for just reuse is really powerful as well.
Yeah, definitely.
Yeah.
I always found when I was growing up, you know, when I went through college, you know,
my professors always told me any good programming, good programmer knows like three or four different languages.
Like that's, you know, what they kept drilling into us.
And it's funny, we always talked about learning different languages, but we never ever spoke about putting them together.
You know what I mean?
And kind of like what you were saying, right?
I feel like that's kind of where we are.
Like no one knows one language.
You know, like no one that works in a company in a really productive ecosystem does one thing.
You probably know some JavaScript and some Python and some, you know, Go and Rust and SQL and like there's stuff in there.
But how do we put that stuff together in a very clean and like maintainable way?
Yeah.
Another thing, you know, thinking back to the times when we were all in college, so much of what we did was like really low level.
Like, oh, I need to, you know, load this file.
So I got to write the binary bits to parse this file, right?
It was like super low level and it took a long time.
And these days it's more about Lego blocks.
Get this thing, that thing, click them together and make that piece go over there, right?
And this whole interop for that is also, you know, makes sense in that world.
Yeah.
Well, we have some, you have some cool, I want to plug your stuff.
So we don't have a sponsor.
So we'll plug your training.
Yeah.
So, yeah.
Thanks, man.
I appreciate it.
Yeah.
Well, you, let me, I'll be specific about something.
Something that I think if you dug through the course catalog, there's a little coming soon graphic, but people probably don't know is we're about to release a course on Dask.
So Dask is a way to do like pandas type stuff.
But if it needs to load 10 terabytes of data and that won't fit even on your hard drive, or you want to run it across, you know, 16 cores on your machine across 10 machines, you just write pandas code, but you point it somewhere else.
And it just parallelizes that beautifully with this cool little dashboard.
So anyway, there's a free course coming on Dask that people will be able to take really, really soon.
That'll be fun.
No, it's good.
I think everybody should check out your course catalog.
And one of the best things that happened to the Python community was when you quit your full time job and started working on this full time.
Thanks.
A short four or five years ago.
I would definitely concur with that.
I'm curious about Dask too, because I remember you all speaking about it in a previous podcast.
And I always wondered, oh, wow, is this only for pandas?
Or can I use Dask to just run remote Python anywhere I wanted to?
I think you can actually, I do think you can make it run remote Python.
The simple use case is sort of import something different that looks like pandas and use it, you know?
But I think there's a way, there's like a lower level set of libraries that do that orchestration.
You probably could use it.
I'm trying to remember and make sure that that's the right one.
I think that's what Matthew Rockland pointed out when we were talking about it.
So, yeah, quite cool.
Yeah, because that would make, for me, makes Python really interesting from a distributed systems perspective.
Yeah.
Again, we think about like containers and multiple VMs and even just talking across boundaries of networks, right?
Yeah.
Yeah, and just being able to import my library and run it.
You know what I mean?
Yeah, absolutely.
Super cool.
All right, Brian, you got the next one?
Yeah.
So, speaking of learning to code, you know, as you go on with your learning to code, there's tutorials and stuff.
But then you want to get into really finding out how things, people are really solving problems all over the place.
And a great discussion around that is to, and good recommendations, is to just go read some code.
You need to read a lot of code.
And there's problems with that, though.
And so, this is an interesting article I'm going to link to.
Learning to read code, Python Standard Library Design Decisions Explained for Advanced Beginners.
That's an interesting term, advanced beginners.
But, so, there's an interesting discussion around this.
So, the standard library is there.
So, that's a great thing to go look at.
It's available.
And all of it's there, so you can read all of it.
But there's some interesting caveats and some in both good and bad.
So, there's pros and cons.
One of the pros is all the peps are around.
So, you can read the design decisions of why things are the way they are.
And some of the history and what problem they're trying to solve.
That's actually an incredible benefit because I don't even get that with, like, internal code often with a company.
It's often just the code that was left to me that I have to maintain.
So, this is kind of neat.
And usually, it was done just enough to work and then we're done with it.
Yeah.
So, and Python gets to improve on itself, which is nice.
The downside is there's a lot of it and a lot of it's really old.
So, there's some code in there from 10 to 20 years ago.
And there's what's Pythonic now might not have been Pythonic then.
So, maybe not best practices.
I don't know this firsthand, but this is a comment from the article.
So, I think that's fair.
And also, you don't really want to learn.
This isn't necessarily from the Python Center Library, but just picking something that you use on GitHub.
It could be incredibly useful.
That doesn't mean that it's coded well, though.
So, it might not be a good example for coding.
So, the author has three or four different standard libraries that it recommends, which is pretty interesting.
The statistics module.
It says the code is simple and it's fairly well documented.
And the PEP describes...
I think it's also pretty new, which is kind of a...
Oh, really?
Good.
I'm not sure when the statistics...
But it was added.
It didn't come originally.
It's been added after a while.
But there's other things around that people use statistics for statistics.
So, the PEP apparently talks about design decisions about not trying to reimplement NumPy or something like that within the standard library.
But just have basic statistics.
3.4, by the way, is when statistics showed up.
Oh, yeah.
So, it's not that old, right?
Yeah.
And actually, the next two are fairly recent as well.
Pathlib is recommended because it's extremely well documented.
And it's...
Oh, no.
And object-oriented, good object-oriented example.
There's not a lot of object-oriented examples out there in Python because a lot of people don't use it.
So, it's good.
Also, a nice comparative study because we already had OSPath.
So, you can look at how OSPath solved it versus Pathlib solving the same problem.
That's kind of neat.
Data classes is apparently very well documented.
And I'm not sure what else I was going to say because I wrote down, it's a good example of data classes.
That doesn't make sense.
It may be the very best example of data classes implementation.
Yeah.
Or the only.
And then Graphlib, which says it's a bonus, but it's interesting because it does one thing.
It's an implementation of a topological sort algorithm, which I'm not exactly 100% sure what that is.
But it's a narrow problem.
And there's no PEP, but apparently there's an issue that the article links to with a long thread discretion.
And the interesting thing about this isn't the discussion about how it should be implemented.
It's the discussion of what the API should look like.
So, how it should be used from a user perspective.
And that actually seems fascinating to me because I think we need to talk about that more of people.
How designing APIs and coming to terms with that is almost more important than what the code looks like.
Because you have to live with the API.
You can change the code later if you need to.
Yeah.
That's a good point because you can refactor internally.
But yeah, the API you're stuck with.
Unless you're like one of the packages I use for security on the website today.
That just completely changed a bunch of the module names and submodules and moved classes around.
And then my website in dev, not in production, wouldn't start after I updated it.
I'm like, well, I don't understand.
Shouldn't there be at least a deprecation warning for a little bit or something?
Nope.
Oh, well.
One of the things I really like about articles like this.
Oh, I'm sorry.
Yeah, I was going to say.
One of the things I really like about articles like this is, you know, we often talk about like the beginner path.
Like how do I get started with a thing?
But after we've, you know, you know, brought all these beginners together, like how do I take you from beginner plus plus?
Like what is like the next step look like?
And, you know, you always hear folks talk about just you got to read code, right?
Like go to GitHub and click browse and kind of just dig around projects that you're interested in and things you want to learn about and kind of just try and understand how it works.
Right.
Like if you want to understand how Flask works, if you want to see how folks use different things and FastAPI or Django or even Tortoise that Michael was showing a little while ago.
I mean, just it's open source, right?
And that's the beauty about it.
Yeah.
You just go on GitHub and just read the code and then, you know, change it, right?
Change it on your machine and see what it does and see, does it get faster?
Is it slower?
Is it more or less readable?
You know, do you understand it a little better?
Did the test make sense?
Brian could tell you about like writing good tests for different packages and stuff.
But I think we need to do more of this.
Like, and we as like an industry, because I feel like we're like a drowning in how to get started content now on this level.
You know what I mean?
Let's go like one step above that now and start to talk about like what is the step two, three, four look like, you know, between junior and senior.
Yeah, there's definitely that cliff.
Brian, you got a learning curve here to back this up?
Yeah.
No, I just saw this interesting graphic.
I think you muted, Brian.
Oh, yeah.
I saw this interesting graphic and I kind of related to it really well in production.
I'm not sure about the early parts of the learning curve.
But the end part is welcome to production programming where there's strange mission critical code left behind by the last developer.
And I mean, actually, this is, you know, funny, but also it's true.
In, you know, production code in a company, you often have to support code that you don't know what the decisions are.
You don't.
It's just it's working, but you're not sure why it's working.
And yeah, there's some strange stuff.
Yeah.
It can definitely get weird in that stage.
But Cecil, I agree that going from like, oh, I learned, learned the language so I can actually do stuff that there's a huge gap right there.
Dean out in the live stream says, I wonder if some design decisions that were best in the 90s are less optimal today.
I feel like in the 90s it was all about object, object orienting all the things.
And then there was like a push, like, you know, maybe that's not the best way to just develop everything.
Like maybe a little bit mix, a little bit of composition and so on.
That's fun.
And then John says, coming from a number of other languages, when I first started using Python, I took a conscious effort to seek out learning the idiomatic on way of doing things.
And I think that's really important because it's so easy to just get it to work and then like leave it there.
And you're like, no one would ever do this.
Well, you wouldn't like put your number in a fake for loop that increments that.
And it goes the other way, too.
So like Cecil mentioned, real developers, if you work a professional developer is going to know several languages.
But it's not just knowing three languages and knowing how to code C in three different languages.
It's about learning the idiomatic way to do Python.
It's learning how to do C# the way other C# developers do it.
It's not just about trying to translate your own language into three languages or something.
And it's even simple stuff like variable naming and function naming, right?
In Java, you start with a lowercase letter, then have camel case in a Python.
It's all lowercase.
C#.
I mean, it's just like this person clearly is not of this ecosystem.
Like you can just tell straight away just by weird things like naming that are so easy to change.
Yeah.
I think that's one of the things you see a lot when people do like those auto-generated libraries.
You know, so I know some folks, if you're familiar with things like OpenAPI and Autoress and things of that nature,
like you point a thing at your API definition, it just generates stuff.
Right?
But what if the casing doesn't match, right?
So if I generate like a Java library and a JavaScript library and a Python library, you know,
but like the casing is going to be different across all those idiomatically.
But like now these code generator things have to kind of take that into consideration as they're building out these libraries.
Your classes like Pydantic that automatically map them over now have to look like Java classes or whatever.
I did see in Pydantic that you can now have an alias.
So it's like this is what it looks like in JavaScript, but it has this other proper name, like this Python name in Python,
which is I think it's kind of cool.
All right.
Let's talk about something that's really fun and visual.
So there's this thing called Bradio, Gradio, something.
I'm messing up the pronunciation.
I'm sure this comes to us from David Smith.
So thanks for sending that over.
And this is a really cool way to add simple interactive UIs to your machine learning scripts.
So it says generate an easy to use UI for your ML model function or API with only a few lines of code
and integrate it directly into your Python notebook or share a link with anyone.
So here, like all beautiful user interface things, it actually has not just graphics, but interactive graphics.
So you might import Gradio and then write the code that implements it
and then just give it the function that it wants to use and say the input is a sketchpad
and the output is a label run and that's the implementation.
So here's a machine learning model that allows me to draw an ink and then tell me what letter it is.
So if I did like this, it'll tell you, oh, I think that's a seven.
That's not a seven.
Let's see.
What about a one?
You think that's, I think that's a four.
This model is not very good, but that's not the problem.
That's not the point, right?
That should be a five.
I'm going to draw, I'm going to do a zero.
There we go.
Yes.
I nailed it with a zero.
Two.
Yeah, two and those two.
I don't know.
The point is not that the model is accurate, but this is a really cool UI that you can build
in a couple of lines of code, right?
I think that's super.
Yeah, this is pretty nice.
Yeah.
Let's see what other examples they got in here.
Question and answer with a paragraph.
So here's the text that the source text is, you know, Victoria has written a constitution
enacted in 1975, et cetera, et cetera.
And then you could ask the model the question, when did Victoria enact its constitution?
Holy moly.
Wait for it.
1975.
Like that is insane.
Right?
And you could cool this.
You can build this cool UI here, a face segmentation.
I'm not going to do my webcam.
It's going to break stuff for the live stream.
Yeah, all sorts of things though, like little sliders and whatnot.
We need social distancing.
Yes.
There we go.
So pretty neat way to really simply add UIs and integrate them both onto websites and into
Jupyter notebooks.
Nice.
I like it.
Yeah.
I love too that it's just running in the browser too.
I know.
That's awesome.
Yeah.
I mean, that's proper JavaScript work to be putting like a little sketch pad and then
taking that image and sending it back up.
Dean helping us with the naming.
So ML models usually use gradients.
So called grade in slang terms, I guess grade IO.
Yeah, that sounds good.
Cool.
Thanks.
All right.
So you can take us out of here with the last one you got.
Yeah, sure.
Let's take a look.
All right.
So my screen should be up now.
So there's this movie that's coming out later this summer, 2021 called Space Jam.
I don't know if you ever heard about Space Jam, but heard about it.
I don't know enough.
What's that?
I only heard of it.
I haven't seen it.
Yeah.
I mean, you know, I know if anyone that's born after like the year 2000 probably has never
heard of Space Jam.
But what we actually did, so Microsoft and some folks at Warner Brothers, I believe, partnered
together to create like a set of learning modules and stuff like that around basketball.
And it was completely inspired by Space Jam.
So what you're looking at here is a learning path.
And this learning path, I think, has one, two, three.
It has about three different modules in here.
And it kind of walks you through exploring basketball data.
And you can use that to start like predicting the outcomes of games and player performance and
all this cool stuff.
But it uses Python.
It uses Pandas.
It uses VS Code.
There is some JavaScript in there.
And there's some like real, you know, there's some NBA data in there.
There's some basketball data in there.
You kind of use and explore and play around with.
So I think this is really cool.
Again, going back to the conversation we had before about like, you know, okay, I know some
Python, right?
Like, how do I do some cool stuff with it?
Right?
Like, what's the next step?
And I thought this was a great example of us showing, hey, let me take something that I
actually care about.
Maybe some of you all care about basketball.
Maybe some of you don't.
But, you know, whether it's sports or racing or, you know, maybe you like to listen to podcasts.
How can I take podcast data and run some machine learning and, you know, different things
around it?
Like, I think these are all really cool projects for you to think about.
But this one specifically is about like using basketball stats, you know, inspired by Space
Jam and using Python and Pandas and just, you know, just creating some really cool projects
out of it.
So I thought this was cool.
Hopefully folks check it out and let us know what you think.
Nice.
So this is a free like learning thing that people can go check out, right?
Yeah, this is this is 100% free.
Excuse me.
It's 100% free.
Free as in like, I don't need your, you know, your address and information and all of that.
Like you could just go out.
It's a credit card.
You cancel anytime.
It's totally free.
One thing I would tell you, if you do decide to create an account.
So I have an account here.
So you'll notice you'll get points.
You get XP points.
So this one is worth 4000 XP.
So if I get that, you know, hopefully I'll bump up and I'll be at a level.
You're going to go to level nine if you get if you finish this one.
Yeah, yeah, yeah.
So I want to I want to make sure I get it make some time to go through this learning
this learning path.
But if you do want to sign up, you know, it's a good way to keep score.
You get badges and all kinds of stuff.
We do have other Python related courses in here, too.
Like we just released a intro to Django on here.
That's in here as well.
So if folks are interested in that and, you know, did you guys do something with Dr.
Becky around like NASA or something?
Or is that?
Yeah, yeah, yeah.
We did have we do have one that's around the moon landing.
And then also, if you remember that that Netflix movie, I think it's called Over the Moon or
something like that.
There's also a learn module, I believe, that's also associated with that movie that we partner
with Netflix on.
So that was also super cool.
Yeah.
Nice.
What I really like about this is when people are trying to get into program, especially
taking that next step of like, OK, I've learned what a loop is.
It's so hard to know what can I build because you have these like, well, I'd love to build
a game like, well, building a game takes a team of people in a year.
Like that's not a good next step.
It's just like knowing what the next thing to build.
It's a little more complicated that you're really actually interested in.
You want to build like this is the type of thing, you know, if you had a like a coding
club at a high school, maybe COVID times is not the best for this, but you could say,
let's build an app that will do like statistics for our basketball team and like all sorts
of interesting things like you could build really neat stuff and put it together in ways
I think people will care about.
Yeah, exactly.
And I'm just like I said, just in general, I think the best way for you to go from beginner
to whatever that next level is, is just find something that you really care about and see
if you can attach technology to it.
You know, like I care about basketball.
I've been watching basketball for years.
So when I heard Space Jam and Python, I'm like, oh, that's easy.
You know what I mean?
Like, yes, like that's something that I care about.
That's something I want to do.
Like we mentioned before, we have ones on NASA, but maybe you're into some other stuff.
Maybe you're into, you know, agriculture and flowers and plants.
Maybe you want to do something that categorizes that type of stuff.
Maybe you're into cars.
Maybe you like racing or, you know, some other activity.
You know, find a way that you can integrate what you're doing with, you know, in your real
world life with what you're doing in your computer life.
Right.
And see if we can put those together.
I think there'd be awesome IoT stuff to do with agriculture.
Yeah, for sure.
I think so, too.
You know, I've heard about like a lot of different projects that, you know, use IoT, you know,
particularly outside of the United States to do things like detecting diseases and, you
know, letting them know when's the right time to like manage crops and, you know, getting
information from, you know, weather APIs and like using it inside of their IoT devices and
stuff like that to help make decisions, which I think is really cool.
Yeah.
And, you know, when you think about.
You could look at the crops and say, how wet is this?
You know, could it hold out 12 more hours?
Because I see it's going to rain in 12 hours.
So, like, let's not waste the water now.
Save some.
Yeah, exactly.
Like little micro optimizations like that.
That'll probably won't save you a lot of money and resources.
But then also make sure that you're, you know, you can control your environment.
Yeah.
But yeah, I think those are all really cool use cases that, you know, we should definitely
encourage more folks to get involved in.
Yeah.
So I don't know if we should go down it, but Dean is calling Jordan the goat.
I don't know what's going on here.
I agree with him 100%.
I would defend that any day.
It goes Jordan, Kobe, LeBron.
That's how it goes in my head.
Awesome.
All right.
Well, that's all of our main items.
Brian, do you have anything extra you want to give a shout out to?
No, but I just wanted to say, I thought it was a trick question when you said, do you
know what Space Jam is?
And I thought everybody knew what Space Jam was.
I had to look it up.
I didn't realize it came out in 96.
So it's been a while.
Absolutely.
Yeah.
That's what I said.
If you're born after 2000, like, you know, what Space Jam is?
If you've got good parents, you'll know because they would have shown you.
I actually made my son watch it like a couple of weeks ago.
Yeah.
Did he enjoy it?
Yeah.
He loved it.
Now, you know, one day I came home.
He's just like, daddy, what are we going to watch tonight?
I'm like, I don't know.
What do you want to watch?
That's what Space Jam.
I'm like, yes, I'm a good father.
Yes.
Got it.
My wife and I tried to have our daughters watch all the James Bond 007 stuff.
The natural way would be to start at the very first one with Sean Connery and make
your way up to Daniel Craig.
And today they watched like 10 minutes.
Like this is so fake.
I can't watch this.
Yeah.
Different generation.
Yeah.
It's different.
All right.
So let's see.
Cecily, got anything you want to give a quick shout out to that didn't land in the main topics?
I feel like I should have prepared for this.
Yeah.
No, I don't think so.
Tell me about the Twitch.
Are you still doing the Twitch streams, Brian?
Yeah, we're still doing the Twitch streams.
Other Brian, Brian Clark.
My co-host Brian had taken some time off because Brian had a baby.
So congratulations to Brian and his family.
Congratulations.
But he will be back.
Well, he is back, but we'll be live streaming again starting next week.
Now that he's back and settled and stuff like that.
But yeah, we do a weekly live stream on Twitch.
So you can go to twitch.tv.
I think it is.
Twitch.tv slash Microsoft Developer.
It's every Wednesday at 1.30 p.m.
Eastern Standard Time.
And we just, you know, we talk all things Python.
We do different projects.
Yeah, I believe both of you gentlemen have been on.
We've had, you know, Brian come on to talk about testing and solve some problems that I was having.
And Michael, you came on too, which was great.
And yeah, we just, you know, we try and take a beginner's perspective.
You know what I mean?
You know, my Brian, not Brian on the stream, but like my co-host Brian and myself, we try to take it from the perspective of, okay, well, he knows JavaScript.
I know C#, let's come together and like play around with Python and, you know, show all the mistakes and the typos and, you know, the things that happen that we don't always see on video and live streams and show people like, well, you know, anyone could really just take the time to learn.
You just got to put in the effort.
Yeah, awesome.
Yeah, people should definitely check that out.
That's well done.
So before I give my quick one item that I want to share, Dean says, PyCon Israel is next week, May 2nd and 3rd.
It's free and virtual.
So all are welcome.
Yeah.
Thanks for that real time update.
And then, Brian, people are loving our, what you call it, the absolute privacy updates to the site.
Check this out.
154 people like some random update about removing analytics from the website.
I think that's great.
Yeah.
So now if you go to like pythonbytes.fm in Firefox and you look, there's perfect security shield, perfect privacy shield.
And we happen to be live streaming.
So did you just remove Google Analytics from it?
Is that what you did?
We were using GetClicky, which is like a more real time, but I think Google Analytics is basically the same.
The thing I liked about GetClicky is it was a paid service that didn't share your data with advertisers.
So it was better, at least in that regard.
But all the ad blockers and everything were already like degrading the data so badly that it was kind of like, well, it's maybe half of the population.
I don't know that we get information about it.
So let's just take it out.
Right.
Got it.
All right.
I wish we would have had this joke last week, maybe two weeks ago, but I've got a good joke for us.
You know, there was that giant evergreen shipping container thing that clogged up the canals at the Suez Canal.
Costs like $400 million an hour lost commerce with the Middle East and Europe.
Right.
That was bad.
So there's this great joke here about Linux containers and Kubernetes.
So it's got the evergreen ship stuck sideways and like another shipping container clearly stopped.
Like this is blocked.
We can't make it through.
And then the title is Linux containers and Kubernetes for beginners.
Like containers.
Yeah, that'll fix it.
Hilarious.
That's hilarious.
By the way, did they ever get that thing out?
It got out like a week ago, I think.
Yeah.
Eventually they had to dig the sand out underneath it until it could float again, basically.
Oh my gosh.
That's ridiculous.
And then Cecil, are you a fan of the Oh Really covers?
I am.
Yeah.
So we've got the Oh Really instead of O'Reilly.
Kubernetes for beginners.
What could go wrong?
Dev oops.
Nice.
I like it.
Dev oops.
I like it.
But I love the evergreen container ship.
Containers.
That'll fix it.
That's hilarious.
Yeah.
All right, Brian.
Is that it?
Yeah.
Is that a show?
Put a wrap on it?
Nice bow.
Yeah.
Good job.
Good guest.
Yeah.
Great guest, Cecil.
Super to catch up with you.
Thank you for being on the show again.
Thanks, everybody.
Thank you both for having me come on, man.
Again, it's always a fun time.
I'm trying to break the record.
I want to know who your most frequent guest is and whatever that is, I want to break the
record.
Oh, I'm going to get one of those great IO type things and point it at our site and then
I'll ask it.
Yeah.
Let me know.
No, I think actually probably you're near the top.
I have to do some counting.
We'll have to see.
But yeah, for sure.
Yeah.
Let me know.
I got to make sure I keep standards high.
That's right.
Brett Cannon out there in the live stream.
If he's still there, he's definitely one.
He's one of the contenders as well.
So we'll let you know.
Okay.
Yeah.
Cool.
Well, bye, everybody.
Bye, everyone.
Take care.
See ya.
Thank you for listening to Python Bytes.
Follow the show on Twitter via at Python Bytes.
That's Python Bytes as in B-Y-T-E-S.
And get the full show notes at Python Bytes.fm.
If you have a news item you want featured, just visit Python Bytes.fm 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.