Hello and welcome to Python Bytes. It's episode 24 and we are going to deliver Python news and headlines directly to your earbuds.
This episode is recorded on May 2nd, 2017 and is brought to you by Rollbar.
I'm Michael Kennedy.
And I'm Brian Okken.
And we're here to bring you a bunch of Python news, but this time it's a little different.
Normally we're broadcasting from two secret locations in Portland, Oregon, but this time, Brian, you're dialing from slightly farther away.
Yeah, I'm just south, what, southeast of Munich today.
Right on. Well, welcome to Europe. Let's start with learning Python out of Munich.
Yeah, so this is one of the, I think a listener of the show contacted us, said he wrote a learning Python series,
but he wrote it for a group called Robotics and Beyond.
And it's a STEM educational space, which really looks cool.
But he's, I think it looks like a nice tutorial and he's publishing it on Dan Bader's site, dbader.org.
And the first in the series is, let's program with Python statements, variables, and loops.
And I think he's coming at it from a space of, if you, yeah, just really getting started, haven't done much.
And I like, he's even talking about, goes through, even what is programming.
He's assuming people haven't done programming before.
So talking about how it's telling people how to, how you're telling the computer how to do steps.
And, and, and, you know, it's, it's hard for me to put my head back in the space of new to programming.
But I think this is, it looks like a, something that might be good for, I don't know what age group, but it'd be good.
Yeah. Well, we're going to talk about a lot of different age groups, but way to go, Doug.
That's awesome.
It's really hard to, you know, get rid of the curse of knowledge, right?
Once you've learned a thing, it's really hard to see it with fresh eyes and understand the challenges and stuff.
So that's really cool.
And don't you wish something like robotics and beyond existed when you were a kid?
Yeah, I do.
And one of the things that I like also about having lots of different people tackle the new to programming space is that everybody learns differently.
So you might look at one series and go, man, I just don't get it.
And then look at somebody else's and it just clicks like this.
This one uses turtle graphics and stuff.
I haven't seen people use turtle graphics very much recently, but so that's kind of fun.
Oh yeah.
Very cool.
Nice.
All right.
That's a great one.
So check that out.
If people ask you for how to get started programming, right?
Maybe kids.
There's a lot of good options.
Here's one more.
So speaking of learning to program, I picked one that is an actual academic paper, but I felt it was pretty interesting.
This is done by Philip Guau.
I've had him on Talk Python a few times.
In this one, he's talking about helping older adults learn to become programmers or become more proficient in programming.
Like what you were just talking about.
There's a lot of, hey, you're a young kid.
You want to get started with robots and programming and here's how you do it and we'll get you going to launch your career and stuff.
But Philip said like so many of these resources are focused on the young teenage to early 20s group starting their career.
But, you know, how much do we really know about people who are 60 to 85 years old who are just learning to program?
So he actually wrote a proper academic paper and did a bunch of research on those guys.
Wow.
I think that's cool.
It is really cool.
The age group, I guess I wouldn't expect people from in the like, I guess you've listed 60 to 85.
Was that the age group of the respondents?
That was the age group of the respondents.
Yeah.
If you were outside of that age range, mostly younger, then you were sort of not included.
Right.
Like it was really focused on people who were basically either about to retire or who were retired.
And it looked at a couple of different aspects.
Like why are they interested in learning a program?
What challenges do they have that they share with everyone who's learning a program?
Like what's a variable?
Ah, what's a pointer, right?
Like everybody suffers that.
But there's also specific challenges for that age group.
And then also, you know, just what are they using to learn?
And some of the lessons on how maybe we can make the whole environment better for those guys as well.
I think that's great.
Yeah, I do too.
So I think it's interesting to look at what some of the reasons why people in this age group were learning to program.
Some of them just said like, look, I'm now retiring and I've always wanted to learn to program.
And maybe I did something technical.
Like maybe I was a scientist, but I never really got around to really learning to programming.
So that might be one reason.
Another was connecting with grandchildren.
So a lot of these folks have children who are maybe taking this robotics and beyond type course.
And they're like, hey, I would love to do that with my grandchild.
But let me, I got to learn Python myself, right?
Another big opportunity here is there's a pretty big gap between people can do programming and people are teaching kids.
And so people in this age group also have a lot of time if they're retired to maybe donate, you know, an hour or two a week at some place mentoring or something like that.
So maybe they could fill in this, like sort of help teachers at high schools and middle schools with actually teaching programming and not just like the coding class teaches HTML, right?
Something like that.
As well as like just keeping mentally active and pursuing hobbies, right?
Like their hobby is airplanes and they are going to create something that works with airplanes somehow.
Yeah, I think, and then I could see probably the maker space getting into that and people trying to program Raspberry Pis and stuff like that.
Yeah, absolutely.
Absolutely.
There's a lot of cool stuff, a lot of cool times with like the micro Python type of stuff as well.
So if you're interested in this, check this out.
I'm also planning on doing a full proper Talk Python episode with Philip in a few weeks.
So we'll catch up on that and go deeper on that show.
Okay, great.
Hey, so next up, I've got something that I've been, we talked about, I can't even remember what episode.
I was looking for a good way to have a local PyPI server just like so you can sort of not have to go out onto PyPI all the time.
And especially on the plane trip when I was flying over here, I knew I wouldn't have an internet connection.
So I wanted to make sure I had a cache of all of the packages I needed for while I was programming on the plane.
And I don't know when this crept in, but there's, pip has download now and I don't think it used to always have that.
But you can just, and I've got the, I put just the few lines of code you need in our show notes.
But it's just, you go to a directory you want and you type pip download and some package and it downloads that package and all of its dependencies and doesn't install it.
It just stores the wheels in that directory.
Yeah, that's super cool.
So you can, you can basically create an offline version of PyPI.
And it just, it's really quick.
You can even list multiple packages on the line.
I just, I knew like the 10 or 12 that I needed and didn't know what their dependencies were and just filled up a directory in like 10 minutes or less.
And then I was ready to go.
And then you just have to use the, when you're doing the install, you do the --no index and --find links and point it to your directory.
And then the rest is the same.
You just give it a package.
And this includes like version numbers.
So you can, you can have multiple versions in there as well.
So anyway, just wanted to share that with everybody.
Nice.
Do you know if I can, can I give it like a requirements TXT and say, download that, you know, download the results that I suspect you can, right?
Probably pip download dash r requirements, you know, dot TXT, I bet.
Probably.
I don't usually work with requirements files, so.
Nice.
Okay.
This is a cool thing.
So if you maybe were going to be stuck on an airplane and trains and other places for like 18 hours straight, you might want to take some packages with you, right?
Yes.
That's awesome.
Okay.
So that's a really, really cool tip there.
I know there's the, like the dev pie and the actual local proper pipe AI servers that you can set up and just point at the URL, but I didn't know about this, this local download option.
So this is great.
And that the, all those other little pipe AI servers, I know that the setup says that they're really easy, but I haven't been able to get it to work for me.
So I don't know what I'm doing wrong, but anyway, so this is easy.
Yeah.
This definitely like everybody has a directory, so they can do it.
You don't have to have the right infrastructure around it.
That's cool.
All right.
Before we get onto the next item, which is about adding features to the Python language itself, I want to just say thanks to Rollbar.
You guys have heard me talk about Rollbar a lot.
You know that I use Rollbar on my websites and really, really like Rollbar.
Basically, all you have to do is pip install Rollbar, maybe include a line or two in the config or setup for your Python web app, and it's tracking all these errors and sending you reports and notifications with lots of details anytime it happens.
So these guys are going to have a booth at PyCon.
They're going to be just like us, Brian.
We're all going to have booths at PyCon.
Yeah.
I'm going to have to go get a Rollbar sticker for them.
Yeah.
Definitely get a Rollbar sticker, maybe a Rollbar shirt.
I don't know what kind of swag they're bringing to the show, but they want to make sure that you know there's a booth for Rollbar at PyCon.
And so drop by and they'll give you a demo and give you some kind of swag to go with it.
Awesome.
Yeah.
So just check them out.
Rollbar.com slash Python bytes.
Get the bootstrap plan for free, which is 100,000 events and 180 days of retention.
And hopefully you don't use up that many errors.
But if you do, they got you covered.
All right.
So you know what would be cool is if we could have increment and decrement operators in Python.
We can do plus equals one, but think of all the characters we're wasting there.
What if we could just do plus plus?
Yeah.
Do you know why Python doesn't have increment and decrement operators?
I have a theory, but I don't actually know.
I don't know why.
Do you?
Certainly the language was created after.
No, I mean, it was created after C and C++, right?
So it's not like it wasn't known as a possibility.
I suspect it was to keep it more explicit, right?
You know, one of the challenges of plus plus and minus minus and those types of things is
a lot of languages that support them support like two variations, like plus plus variable
and variable plus plus.
And it's always like, okay, well, what that increments it and then returns the incremented
value versus returns original value and then increment is just like, it's kind of confusing.
Like why is like increment confusing?
And so I suspect Coeta is just like, all right, just simple.
It's also like, like in C++, it matters which side of the assignment operator it's on to.
If it's an L value and R value.
So yes, all those things.
And so it doesn't have one, but friend of the show, Anthony Shaw said, let's see what it would
be like if we tried to add one.
And I think this is cool because it actually, his article on Medium takes you through step
by step what it is you need to do to add a new feature to the Python language.
So basically he writes an article that adds plus plus and minus minus to CPython.
I like the, where he's going with it and also teaching people how to do this.
It's kind of neat.
Yeah.
It certainly takes some of the mystery of like, well, how would you even start out of
this?
So he says, look, there's basically five or six levels.
So you're going to start by doing a PEP to get agreement on what the language feature is
going to be.
Then there's a grammar file that describes what the statements in Python are.
You don't want to just cram it into CPython, the execution engine, because things like
PyPy and other implementations, you want those to stay consistent.
So there's this grammar file they all share.
It talks about how to add them.
And it turns out it's like super easy to add these, these new things.
Then there's the Lexer that parses it.
Lexer that goes through and sorry, turns it to tokens.
Then the parser takes the tokens to abstract syntax trees.
And then there's a compiler actually compiles it to instructions.
So he goes through all the steps and shows you how it works.
And even has his attempt to add this feature to Python itself out on GitHub, if you want
to check it out.
So he's got a working version with plus plus.
That's pretty cool.
Maybe we could get him to add begin and end to blocks.
Hopefully he's no.
And curly braces.
We all love the curly braces.
No, just kidding.
Okay, so that's awesome.
Another thing that you brought up that I like is colorful, right?
So I think so many of the apps that we create in Python are sort of terminal level or CLI type
apps.
So people really could do more to make them pretty, right?
Yeah.
So I've been working a lot with pytest lately.
And one of the great benefits of it is the color in the terminal window.
And working with terminal colors isn't, this is often not very fun.
But this colorful project is actually got a syntax that's pretty darn readable.
And once you've figured out what colors and what syntax, what different parts of your interface,
your command line interface, you want different colors.
I don't think you're going to really have to care, like really muck with it too much using colorful.
And it even has things like piping colors to strings and like different plus and and operators
that make sense with colors.
And I like what they're going doing with this.
Yeah, that's cool.
I do as well.
And the couple of things that really stood out is nice to me.
One is the syntax is pretty straightforward on how you use it.
The fact that you can use hexadecimal.
So you can just, you know, hash F-A-F-A-F-A for gray or whatever, right?
You can take sort of web colors and plug them in, which is really cool.
And they even have themes, like you can set up general themes.
You can use context managers.
So in a width block, you can set a color, things like that.
Yeah.
Okay.
That's neat.
Yeah.
Pretty sweet.
I might start using it.
I've looked at Colorama and some of the other ones and they're fine, but it's like, I don't
know, it's just painful to say like, okay, well, I'm going to take this like enumerated text
value and concatenate it with my string to make it a color.
And I think colorful is a little nicer.
Yeah.
I wonder if it's built.
I haven't actually tried it.
I wonder if it's built on top of Colorama.
Yeah.
We'll have to look inside.
Anyway.
Speaking of packages, everybody who works on making a Python package, they want to add
a nice bit of bling, make it fancy looking, right?
Yeah.
All the extra little blips and stuff.
Yeah.
So there's a lot of things that make a package look professional or not professional, but there's
this article called five steps to add the bling factor to your Python package.
And I thought it was pretty cool.
I mean, it's certainly not exhaustive.
And it's not, I don't think it's overly prescriptive, but it does talk about a few things that you
can do that are pretty sweet.
So I'll just run through the five steps real quick.
So step one, you can host your documentation on read the docs.
That's nice, right?
Proper documentation somewhere with search and all that kind of stuff.
Set up continuous integration with Travis CI or maybe AppVeer or whatever, right?
But if you're going to set it up, some kind of continuous integration.
And if you're going to run unit tests, you probably want to know what your code coverage
is.
So you can show your code coverage with code cov.
Obviously, if you're going to have a package, if it doesn't live on PyPI, it's almost not real,
right?
Unless there's some weird requirement about like it really has to be set up in some bizarre
way that it can't be installed there from there.
It really should be on PyPI, which is great.
So add it up there and it talks about how to do it.
It's surprisingly easy to get your package onto PyPI.
And finally, if you have all these things, you want to have badges, right?
This thing supports these versions of Python.
Its tests are currently passing or not passing.
It has this level of code coverage, all those things, right?
Yeah.
And one of the things that this highlights for that, I guess I always knew, but I don't think
about it very much is all these different services for open source projects.
They're free.
Yeah.
Every one of those.
Yeah.
But I mean, it's not free for them to run it, but that's cool that all that stuff's just
there for open source projects.
Yeah.
It's really great.
Like, read the docs is free.
They do have ads on there.
I'm not sure how targeted the ads are.
They're pretty relevant to Python developers, but I do think it's a challenge.
I know the read the docs guys are doing interesting and creative things to fund it, but it's,
you know, it's non-trivial to run it for free for the world.
Yeah.
How about Travis CI?
Well, they, I had talked with Josh Calderamis from Travis.
And since they started out as a, like, open source stuff to start with, and they were
doing it in their hobby time, and the commercial side is now how they're doing it full time,
and they have jobs.
And the reason why they maintain the free for open source is because they got their careers
from open source and they want to give back.
Oh, that's really cool.
So if I had, like, a private GitHub repo, I'd have to pay to get CI on it, but if I have a
public one, it's free?
Something like that?
Yeah.
They have an enterprise Travis CI so that you, that you can use for closed repos or private,
not private repos.
Yeah.
Private ones.
Mm-hmm.
So what I thought was cool about this is none of those things are hard.
None of those things are major, but they're all make it, it shows that you care about what
you're building.
So you're more likely to get contributors.
People are more likely to adopt your package, things like that.
Also nice to have all these together because I can imagine if I wanted to do any of these,
I'd probably spend an hour or so trying to figure out each little bit.
Yeah.
There's little tips at each one, which is cool.
Yeah.
All right.
Well, that's our news for the week, Brian.
Anything besides the fact that you're just tooling around Germany?
Well, I think they had, they were, I'm doing management training, so maybe I'll finally learn
how to become a manager after doing it for many years.
But the, but I was working on the, working furiously on the book on the, on the plane trip over.
And we're still on, still barely on target for a beta for PyCon.
So.
I just looked, PyCon is two weeks away.
I can't believe it.
There's not very much time.
I know.
Anyway, I still have to order stickers.
It's going to be so fun though.
Yeah.
You still got time, but not a lot of time.
Not a lot of time.
It's going to be tons of fun.
So I'm looking forward to, to meeting a bunch of the listeners there and hanging out with you
and everyone else.
And how about you?
Anything up with you?
Not, not too much.
Just thinking about PyCon makes me think I got to get a bunch of stuff ready for, for
the conference or a booth and things like that.
So yeah, it should be a lot of fun.
Yeah.
I can't wait.
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 Pythonbytes.fm.
If you have a news item you want featured, just visit Pythonbytes.fm and send it our way.
We're always on the lookout for sharing something cool.
On behalf of myself and Brian Okken, this is Michael Kennedy.
Thank you for listening and sharing this podcast with your friends and colleagues.