WEBVTT

00:00:00.001 --> 00:00:05.260
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.

00:00:05.260 --> 00:00:09.800
This is episode 60, recorded January 10th, 2018.

00:00:09.800 --> 00:00:10.880
I'm Michael Kennedy.

00:00:10.880 --> 00:00:11.700
And I'm Brian Okken.

00:00:11.700 --> 00:00:14.060
And we've got a bunch of stuff lined up for you, as always.

00:00:14.060 --> 00:00:16.100
Before we get to it, I want to say thank you to Datadog.

00:00:16.100 --> 00:00:19.540
Datadog is sponsoring the show at pythonbytes.fm/datadog.

00:00:19.540 --> 00:00:21.580
More to say about that later.

00:00:21.580 --> 00:00:23.220
Brian, I want to know who's at nine.

00:00:23.220 --> 00:00:24.480
Who's at nine?

00:00:24.480 --> 00:00:25.980
Yes, who is at nine?

00:00:25.980 --> 00:00:32.300
Wouldn't it be awesome if you could actually just utter this question into the air and have it automatically answered for you?

00:00:32.300 --> 00:00:37.320
Yeah, well, that's the promise of Alexa and Google Home and all these home assistants, right?

00:00:37.320 --> 00:00:37.880
That's right.

00:00:37.880 --> 00:00:39.700
This came up, what was it?

00:00:39.700 --> 00:00:42.420
Episode 33 of Python Bytes, actually.

00:00:42.420 --> 00:00:45.380
We talked about you brought up building an Alexa skill.

00:00:45.380 --> 00:00:47.640
And then somebody saw that.

00:00:47.640 --> 00:00:49.560
And we have a link to a Twitter thread.

00:00:49.560 --> 00:00:53.300
Yeah, it was Greg Quinlan who posted that on Twitter.

00:00:53.300 --> 00:00:53.720
That's cool.

00:00:53.720 --> 00:00:55.540
Okay, well, he ran with it.

00:00:55.540 --> 00:01:00.300
And he looked into programming both skills for Alexa and Google Home.

00:01:00.300 --> 00:01:05.460
And he came up with this who's at nine video that we have a link to.

00:01:05.460 --> 00:01:07.720
And it's just, I think it's hilarious.

00:01:07.720 --> 00:01:15.600
It's basically the old who's on first routine, but done with an Alexa and a Google Home together.

00:01:15.600 --> 00:01:16.840
It's funny.

00:01:17.000 --> 00:01:21.140
Yeah, so he's got like a little dot and a Google Home.

00:01:21.140 --> 00:01:23.940
And he activates them both and they talk to each other, right?

00:01:23.940 --> 00:01:25.160
It cracked me up.

00:01:25.160 --> 00:01:25.680
It's good.

00:01:25.680 --> 00:01:29.020
We should have like had a clip for it or something for the show.

00:01:29.380 --> 00:01:30.700
Yeah, we should just play it.

00:01:30.700 --> 00:01:31.240
Yeah, that'd be fun.

00:01:31.240 --> 00:01:34.500
One of the things that strikes me, first of all, nice work, Greg.

00:01:34.500 --> 00:01:35.020
That's awesome.

00:01:35.020 --> 00:01:38.600
Flask Ask is really pretty interesting to work with.

00:01:38.600 --> 00:01:42.580
And the Flask Assistant is the Google Assistant equivalent of Flask Ask.

00:01:42.580 --> 00:01:44.200
It's like just ported to that API.

00:01:44.200 --> 00:01:49.880
But what's really interesting to me is the API here effectively is Flask.

00:01:49.960 --> 00:01:52.220
And I'm noticing this in lots and lots of places.

00:01:52.220 --> 00:01:56.580
Like someone just sent us something that was almost a web API for the command line.

00:01:56.580 --> 00:02:01.320
But I'm noticing Flask being like the de facto API for so many things these days.

00:02:01.320 --> 00:02:10.580
Yeah, it must just be that people are just having it's easier to set up a Flask, a small Flask application for something.

00:02:10.580 --> 00:02:11.120
I guess.

00:02:11.120 --> 00:02:14.640
I mean, pay attention to number four on our picks as well.

00:02:14.640 --> 00:02:15.360
We'll come back to this.

00:02:15.360 --> 00:02:20.440
There's something coming up related to the Who's at Nine that's on Talk Python, right?

00:02:20.440 --> 00:02:20.800
Yeah.

00:02:20.800 --> 00:02:29.400
So I have three guys, a panel discussion, who are all involved in building Echo Assistant type things.

00:02:29.400 --> 00:02:32.760
Some of the people behind Flask Ask and some of the people behind Flask Assistant.

00:02:32.760 --> 00:02:38.120
Those are sometimes the same people on Talk Python this week.

00:02:38.120 --> 00:02:42.400
So it should come out just about the same time this episode comes out, which is pretty awesome.

00:02:42.400 --> 00:02:47.300
So if you really like this and you want to dig into it, check out talkpython.fm/146.

00:02:47.300 --> 00:02:48.860
There should be a whole lot there.

00:02:48.860 --> 00:02:49.420
That's cool.

00:02:49.420 --> 00:02:49.680
Yeah.

00:02:49.680 --> 00:02:50.400
I'll check that out.

00:02:50.400 --> 00:02:50.840
Sounds good.

00:02:50.840 --> 00:02:51.720
Yeah.

00:02:51.720 --> 00:02:58.740
So I came across an article that I think it's pretty interesting because you and I have been

00:02:58.740 --> 00:03:01.760
singing the praises of Python, how it's really, really popular.

00:03:01.760 --> 00:03:06.640
It's becoming quite the important language in so many ways, right?

00:03:06.640 --> 00:03:09.000
We talked about the incredible growth of Python, things like that.

00:03:09.420 --> 00:03:15.520
But I guess this struck a chord with me because I feel like one of the places where Python really

00:03:15.520 --> 00:03:22.800
falls down is this sort of the intersection of packaging for delivering an application to

00:03:22.800 --> 00:03:29.600
non-developers or non-servers or packaging, and especially in that area around UIs, like

00:03:29.600 --> 00:03:30.580
native UIs.

00:03:30.580 --> 00:03:31.400
Yeah, definitely.

00:03:31.400 --> 00:03:32.980
We don't have that really.

00:03:33.360 --> 00:03:35.920
It's not as obvious what to do.

00:03:35.920 --> 00:03:36.740
It's not obvious.

00:03:36.740 --> 00:03:38.800
There's a few like half solutions.

00:03:38.800 --> 00:03:40.740
They sometimes work, except for when they don't.

00:03:40.740 --> 00:03:46.980
And, you know, it's the thing that I ran across that made me sort of bring this up again.

00:03:46.980 --> 00:03:50.220
And it's not that I think Python completely sucks because it doesn't have it.

00:03:50.220 --> 00:03:51.440
Obviously, I don't think that.

00:03:51.440 --> 00:03:53.760
But I see it as a major weakness.

00:03:53.760 --> 00:03:59.660
And if we could solve this challenge, I feel like it would just make Python even stronger

00:03:59.660 --> 00:04:05.180
and reach even deeper into like big enterprises that have to have desktop UIs and things like

00:04:05.180 --> 00:04:05.380
that.

00:04:05.380 --> 00:04:09.960
So the article I found is called Retiring Python as a Teaching Language.

00:04:10.460 --> 00:04:12.160
So this is by James Higg.

00:04:12.160 --> 00:04:17.040
And basically he said, for the last 10 years, my advice for someone getting started programming

00:04:17.040 --> 00:04:19.700
is to say, guys, start with Python.

00:04:19.700 --> 00:04:20.220
That's awesome.

00:04:20.220 --> 00:04:24.940
But then he wrote this article to say, actually, that's not my belief anymore.

00:04:24.940 --> 00:04:26.900
That's kind of sad, right?

00:04:26.900 --> 00:04:27.520
It is.

00:04:27.520 --> 00:04:33.020
And it seems, okay, so his big beef really is part of this not being able to do the user

00:04:33.020 --> 00:04:37.200
interfaces like desktop applications easily with it.

00:04:37.200 --> 00:04:37.860
Yeah, absolutely.

00:04:37.860 --> 00:04:38.900
And mobile as well.

00:04:38.900 --> 00:04:41.200
I mean, these kind of are sort of cousins.

00:04:41.200 --> 00:04:42.940
It says, it's all great.

00:04:42.940 --> 00:04:45.300
People work with Python when they're getting started and so on.

00:04:45.300 --> 00:04:50.020
But then one day the student will innocently ask, instead of running a poker simulator on

00:04:50.020 --> 00:04:53.260
the command line, can I just put it on a window with like a button and some cards?

00:04:53.260 --> 00:04:54.280
Yeah.

00:04:54.280 --> 00:04:55.120
Okay.

00:04:55.120 --> 00:04:56.340
So what do you do then, right?

00:04:56.340 --> 00:04:56.720
Yeah.

00:04:56.720 --> 00:04:59.080
Well, there's TK Enter, but I don't know.

00:04:59.080 --> 00:05:03.280
That looks like it's from the early 90s, late 80s.

00:05:03.280 --> 00:05:07.140
It definitely doesn't look fresh and exciting like modern applications do.

00:05:07.780 --> 00:05:11.000
We have Pygame, but that's only if you want a game, right?

00:05:11.000 --> 00:05:14.560
What if I want like an app that I want to...

00:05:14.560 --> 00:05:20.420
So suppose I work at like, say, a stock trading place and I want an app that is like across

00:05:20.420 --> 00:05:26.040
three monitors and it's showing me the status of all my trades running real time, maybe like

00:05:26.040 --> 00:05:31.540
a web socket back to some server as fast as it can be to like completely show the traders

00:05:31.540 --> 00:05:32.220
what's going on.

00:05:32.220 --> 00:05:34.460
Like, what's the answer for Python there?

00:05:34.460 --> 00:05:34.860
Yeah.

00:05:34.860 --> 00:05:38.380
Well, I don't want to diss Pygame too much because I know some people have done some

00:05:38.380 --> 00:05:42.440
non-game things with it, but I don't really have an answer to that either.

00:05:42.440 --> 00:05:43.580
I think that's a big shortcoming.

00:05:43.580 --> 00:05:47.580
And if we had a really good answers for that, like some of the other frameworks, like even

00:05:47.580 --> 00:05:53.060
JavaScript has really good answers for that, which is kind of bizarre, but like Visual Studio

00:05:53.060 --> 00:05:58.120
Code, Atom, those are all Node.js plus JavaScript front-end apps, right?

00:05:58.120 --> 00:05:58.900
That's Electron.js.

00:05:59.200 --> 00:06:03.960
I would like to see a modern sort of thing for Python.

00:06:03.960 --> 00:06:06.800
And I think this is just worth considering.

00:06:06.800 --> 00:06:11.880
You know, actually the Twitter thread that we'll link to the Twitter thread, it's pretty

00:06:11.880 --> 00:06:12.260
interesting.

00:06:12.260 --> 00:06:16.920
If you open up my initial sort of tweet, I don't know if you want to call it a complaint or

00:06:16.920 --> 00:06:20.620
warning to the community, but if you open that, you can scroll down and you can see all the

00:06:20.620 --> 00:06:21.100
conversations.

00:06:21.100 --> 00:06:25.300
And even Guido gets in there a little bit to talk about some of the history, which is pretty

00:06:25.300 --> 00:06:25.760
interesting.

00:06:25.760 --> 00:06:26.660
And thanks for that.

00:06:26.660 --> 00:06:30.560
So I think it's, you know, I just, I don't know that there's a great answer right now,

00:06:30.560 --> 00:06:32.480
but I'm trying to inspire people.

00:06:32.480 --> 00:06:35.000
I want to play devil's advocate here though, a little bit.

00:06:35.000 --> 00:06:40.160
I know that you've said that you have written a lot of desktop applications, but to be honest,

00:06:40.160 --> 00:06:40.860
I have not.

00:06:40.860 --> 00:06:46.380
I've written a couple little tiny things that I've needed for utilities at work.

00:06:46.380 --> 00:06:51.060
There's a whole bunch of programming that is not writing desktop applications.

00:06:51.060 --> 00:06:51.880
Oh, absolutely.

00:06:52.100 --> 00:06:57.220
And a lot of it services, a lot of it's on the web, or it's just command line utilities,

00:06:57.220 --> 00:06:57.760
like you said.

00:06:57.760 --> 00:07:03.500
But here's where I think the actual, this is why I think we're underestimating the importance

00:07:03.500 --> 00:07:04.100
of this.

00:07:04.100 --> 00:07:10.860
If you could open up your editor and it was just, you know, here's a few of the widgets.

00:07:10.860 --> 00:07:17.740
I could just drop them in here and I could just put a .app or a .exe somewhere.

00:07:18.060 --> 00:07:20.740
And my entire company could just pick it up and run it locally.

00:07:20.740 --> 00:07:27.480
How often have you not even can entertain that idea because you're just like, well, that doesn't

00:07:27.480 --> 00:07:27.740
exist.

00:07:27.740 --> 00:07:29.920
So why would I even consider this weird idea?

00:07:29.920 --> 00:07:30.160
Right?

00:07:30.160 --> 00:07:32.240
Like we'd probably also see a lot less.

00:07:32.380 --> 00:07:38.600
I mean, there's a lot of internal projects that are, they're set up as web applications, internal

00:07:38.600 --> 00:07:44.860
web applications that could definitely be desktop applications with a shared database backend

00:07:44.860 --> 00:07:48.780
that we don't do it that way because it's not easy to do that.

00:07:48.780 --> 00:07:49.200
Exactly.

00:07:49.200 --> 00:07:49.960
It's super hard.

00:07:49.960 --> 00:07:56.020
But it would be really nice to have some sort of ability to take advantage of the local

00:07:56.020 --> 00:07:57.880
application, a local OS.

00:07:57.880 --> 00:08:00.920
And maybe you talk to a web service for shared data.

00:08:00.920 --> 00:08:02.880
Maybe you just use SQLite locally.

00:08:02.880 --> 00:08:04.020
That might be interesting.

00:08:04.640 --> 00:08:11.640
But I don't think we do this because it's just like, it's so not working that it's just

00:08:11.640 --> 00:08:15.000
like, even if you got the UI working, it's like, okay, well now what do we do for packaging?

00:08:15.000 --> 00:08:15.440
Right?

00:08:15.440 --> 00:08:17.360
I know there are answers, but they're always kind of tricky.

00:08:17.360 --> 00:08:17.700
Right?

00:08:17.700 --> 00:08:23.500
So if that was like entirely obvious, the tooling was just like, yeah, of course you do this.

00:08:23.500 --> 00:08:28.120
Like how many stores in the, how many apps in the Mac app store would be Python apps?

00:08:28.120 --> 00:08:32.920
Right now I bet it's like 0%, you know, like basically, right?

00:08:32.920 --> 00:08:35.700
Once you round it, then round it down to the significant digits, right?

00:08:35.700 --> 00:08:36.900
They don't exist.

00:08:36.900 --> 00:08:39.480
And these things could just open up, right?

00:08:39.480 --> 00:08:44.480
If we could somehow as a community get like a really nice cross-platform UI set up.

00:08:44.480 --> 00:08:45.140
I agree.

00:08:45.140 --> 00:08:50.160
I think some of the stumbling blocks on that are that little thing that you throw in that's

00:08:50.160 --> 00:08:50.980
cross-platform.

00:08:50.980 --> 00:08:55.820
I know that that's cool, but I don't know if it's necessarily a requirement.

00:08:55.820 --> 00:08:56.500
That's true.

00:08:56.600 --> 00:09:03.460
Actually, I would say if you had a killer way to build macOS apps, stop.

00:09:03.460 --> 00:09:05.380
That would be a huge benefit for Python.

00:09:05.380 --> 00:09:10.500
If you had a killer way to build Windows apps, there's still like the majority of, you know,

00:09:10.500 --> 00:09:13.380
business people sit down and log in on a Windows machine.

00:09:13.380 --> 00:09:17.600
Like if you could do that, that would be an amazing advancement for Python.

00:09:17.600 --> 00:09:18.120
So you're right.

00:09:18.120 --> 00:09:19.300
It doesn't necessarily have to be.

00:09:19.300 --> 00:09:22.980
I mean, one model is what the people at Xamarin are doing.

00:09:23.160 --> 00:09:28.660
They basically have cross-platform stuff, but every platform has its own UI bit, but they

00:09:28.660 --> 00:09:30.480
have these kind of designer things that help with that.

00:09:30.480 --> 00:09:30.960
So I don't know.

00:09:30.960 --> 00:09:34.980
I just wanted to put that out there and let people know about this conversation and think

00:09:34.980 --> 00:09:35.760
about it.

00:09:35.760 --> 00:09:38.820
I think we're having an open session at PyCon on it.

00:09:38.820 --> 00:09:39.700
Oh, that would be good.

00:09:39.700 --> 00:09:40.000
Yeah.

00:09:40.000 --> 00:09:45.320
I think I'm glad we're bringing it up because we do need to hammer on this until it's fixed.

00:09:45.440 --> 00:09:49.440
If I look across all of Python, this is like really the place where there's still a weakness

00:09:49.440 --> 00:09:53.720
and it would be nice to just like fortify that wall and make it like a perfect place to be.

00:09:53.720 --> 00:09:54.080
Definitely.

00:09:54.080 --> 00:09:57.920
And like I said, SQLite as a little database, you don't even need a server.

00:09:57.920 --> 00:09:59.020
That might be a good choice, right?

00:09:59.020 --> 00:10:01.080
Yeah, definitely.

00:10:01.080 --> 00:10:07.920
So I came across, well, this is an older interview, but somebody recommended to us that we go back

00:10:07.920 --> 00:10:11.440
and listen to episode 201 of the Change Log.

00:10:11.940 --> 00:10:17.300
It's another podcast, but there's an interview with the, now I should have looked all these

00:10:17.300 --> 00:10:18.700
names up, but the dude that wrote?

00:10:18.700 --> 00:10:19.260
Richard Hipp.

00:10:19.260 --> 00:10:19.720
Yeah.

00:10:19.720 --> 00:10:20.080
Okay.

00:10:20.080 --> 00:10:21.880
You're awesome for looking that up.

00:10:21.880 --> 00:10:27.220
He started at, he calls it SQLite, which I've never heard it pronounced that way.

00:10:27.220 --> 00:10:31.620
SQLite, as in like a meteorite or something.

00:10:31.620 --> 00:10:32.020
Yeah.

00:10:32.020 --> 00:10:32.940
Or is that mineral?

00:10:32.940 --> 00:10:33.440
Yes.

00:10:33.440 --> 00:10:34.900
A very interesting way of pronunciation.

00:10:34.900 --> 00:10:35.960
None of which I would have guessed.

00:10:35.960 --> 00:10:36.320
Right.

00:10:36.320 --> 00:10:38.880
So the rest of us know this is SQLite, I think.

00:10:38.880 --> 00:10:39.620
That's how I know it.

00:10:39.620 --> 00:10:40.440
That's what I'm calling it.

00:10:40.440 --> 00:10:41.960
I didn't quite realize that.

00:10:41.960 --> 00:10:43.420
So this, this is the database.

00:10:43.420 --> 00:10:49.900
If you just say what SQLite three import in Python, you, you get a little single file database.

00:10:49.900 --> 00:10:52.160
This is beautiful because it's built into Python.

00:10:52.160 --> 00:10:57.780
Every instance, every buddy who has Python has this, so you can just count on it being there

00:10:57.780 --> 00:10:58.740
and it runs in process.

00:10:58.740 --> 00:11:00.160
So there's no configuration, right?

00:11:00.160 --> 00:11:01.000
Yeah, definitely.

00:11:01.240 --> 00:11:08.720
And I didn't realize how dang cool the thing is until I listened to this episode that this change log episode.

00:11:08.720 --> 00:11:17.900
One of the comments from the interviewers were, was they just assumed it was a starter database that you always eventually have to move over to something else.

00:11:18.180 --> 00:11:19.520
And that's not true.

00:11:19.520 --> 00:11:39.360
There's as long as your application is not like a web application with extreme client server concurrency, you probably can get away with like a lot of desktop applications are small or the like, if you have a client side part of your application, that could just be a SQLite database and it'll be fine.

00:11:39.500 --> 00:11:40.120
Yeah, that'd be awesome.

00:11:40.120 --> 00:11:40.320
Yeah.

00:11:40.320 --> 00:11:52.320
So if you had like some sort of client side thing that you periodically wanted to sync with a real database, you could store it all in, in SQLite locally and just synchronize that data across some kind of service with your real data.

00:11:52.320 --> 00:11:57.840
And that would be a real nice way to take the load off the server, to have a local offline version, all sorts of stuff.

00:11:57.840 --> 00:12:05.560
Some things I didn't know about SQLite before I listened to this was that it started its life as a TCL application.

00:12:05.560 --> 00:12:06.360
Yeah.

00:12:06.360 --> 00:12:07.840
Which is bizarre.

00:12:07.840 --> 00:12:09.440
It's very bizarre, but that's what happened.

00:12:09.440 --> 00:12:11.980
Well, I guess that's where like TK started, right?

00:12:11.980 --> 00:12:13.020
In the TCL world.

00:12:13.020 --> 00:12:20.340
But the, also that one of the things that you got to watch out for is that it's not as type safe, it's type flexible.

00:12:20.340 --> 00:12:22.040
Yeah, that's what he called it.

00:12:22.040 --> 00:12:27.540
When you are changing over to another database and your other database might be a little pickier than SQLite.

00:12:27.540 --> 00:12:28.620
So be careful of that.

00:12:28.620 --> 00:12:34.620
So an example, you might have a column, which is in the DDL designated as an integer.

00:12:34.900 --> 00:12:40.080
And if you passed, if you tried to assign quote seven to it, it would just convert that to seven.

00:12:40.080 --> 00:12:41.920
Things like that.

00:12:41.920 --> 00:12:43.600
So it's very funky in that regard.

00:12:43.600 --> 00:12:44.900
It's kind of scripty like that.

00:12:44.900 --> 00:12:47.740
He comes from a background of interpreted languages.

00:12:47.740 --> 00:12:50.940
So it makes, and, and weekly typed.

00:12:51.240 --> 00:12:52.400
So that makes sense.

00:12:52.400 --> 00:12:53.000
It's kind of cool.

00:12:53.000 --> 00:12:53.780
Yeah.

00:12:53.780 --> 00:12:55.980
I thought that, that interview was really interesting.

00:12:55.980 --> 00:12:58.960
Definitely a lot of respect for what he's doing.

00:12:58.960 --> 00:13:07.340
He's got some very different opinions and perspectives on open source, on say version control and editors.

00:13:07.340 --> 00:13:11.420
I mean, I'm not sure I agree with all of them, but they're certainly interesting to think about.

00:13:11.420 --> 00:13:12.340
A couple more things.

00:13:12.340 --> 00:13:16.200
The SQL, how there's a page of how SQLite is tested.

00:13:16.200 --> 00:13:21.940
And I think it's really cool that they put that out there of like what their checklist is for testing it.

00:13:21.940 --> 00:13:23.580
The amount of tests are huge, right?

00:13:23.580 --> 00:13:24.440
Yeah.

00:13:24.440 --> 00:13:28.380
And then also that the, I didn't realize it was in everything.

00:13:28.380 --> 00:13:32.840
Like every Android phone has a, is using it and things like that.

00:13:32.840 --> 00:13:34.040
I think iOS as well.

00:13:34.040 --> 00:13:34.240
Yeah.

00:13:34.240 --> 00:13:34.860
Yeah.

00:13:34.860 --> 00:13:36.440
So it's quite ubiquitous.

00:13:36.440 --> 00:13:38.340
It's definitely ubiquitous and it's very cool.

00:13:38.340 --> 00:13:41.380
And I think it's definitely a good place to start.

00:13:41.380 --> 00:13:52.180
And a lot of, a lot of times you might not need more than, than that, which is one fewer server to configure one fewer things to patch one fewer thing to make sure the firewalls are all right.

00:13:52.180 --> 00:13:54.060
It's really nice to just have that simple thing.

00:13:54.060 --> 00:13:54.700
Nice.

00:13:54.700 --> 00:13:57.940
So speaking of servers, let's talk about data dog real quick.

00:13:57.940 --> 00:14:06.420
So data dog is a monitoring solution that provides deep visibility inside of not just your app, but the infrastructure.

00:14:06.420 --> 00:14:07.500
Your app works with.

00:14:07.500 --> 00:14:14.560
So within a couple of minutes, you could investigate like say a bottleneck in your code by checking out some flame graphs and dashboards.

00:14:14.560 --> 00:14:16.360
You can visualize your Python performance.

00:14:17.360 --> 00:14:23.280
And if you go and do their free trial, you'll get a free data dog t-shirt, which has got a cool little dog on it.

00:14:23.280 --> 00:14:28.140
So check it out for yourself at pythonbytes.fm/data dog and let them know.

00:14:28.140 --> 00:14:29.480
Thanks for sponsoring the show.

00:14:29.480 --> 00:14:29.800
Yeah.

00:14:29.800 --> 00:14:30.240
Thank you.

00:14:30.780 --> 00:14:37.500
So I told you about Flask being this sort of like API that is standing in for all these other, other places.

00:14:37.500 --> 00:14:40.780
So the next thing I wanted to cover is serverless programming.

00:14:40.780 --> 00:14:44.160
So there was this joke, which I actually don't agree with.

00:14:44.240 --> 00:14:51.420
I kind of slightly disagree with it philosophically, but the sort of making fun of cloud computing saying, well, that's just another person's computer.

00:14:51.420 --> 00:14:53.280
There is no cloud.

00:14:53.280 --> 00:14:54.820
It's just another person's computer, right?

00:14:54.820 --> 00:14:55.440
That you're borrowing.

00:14:55.440 --> 00:14:56.400
Isn't that true?

00:14:56.400 --> 00:15:10.140
It's technically true, but my disagreement is like the cloud computing stuff really has to do with a hardware that you can basically create and control through programming.

00:15:10.140 --> 00:15:13.760
So if there's an API that you can say instantly, I want a machine.

00:15:13.760 --> 00:15:15.300
I want to scale my machine.

00:15:15.300 --> 00:15:16.700
I want to replicate my machine.

00:15:16.700 --> 00:15:20.940
That's not the same as just like co-location or like a rented server.

00:15:21.060 --> 00:15:24.980
Because you can't just go and like rent a server and then hit an API and have like another server.

00:15:24.980 --> 00:15:27.860
So anyway, that's my disagreement a little bit.

00:15:27.860 --> 00:15:29.380
But to some degree, that's true, right?

00:15:29.380 --> 00:15:39.860
Well, we've moved beyond that joke to a farther world of potential ridiculousness where we have server-based programs that have no servers, right?

00:15:39.860 --> 00:15:43.740
This whole AWS Lambda, Azure Functions, serverless programming.

00:15:43.740 --> 00:15:44.600
It's kind of funny, right?

00:15:44.600 --> 00:15:45.220
Yes.

00:15:45.220 --> 00:15:45.660
Yes.

00:15:46.140 --> 00:16:00.020
So basically, the idea with this serverless programming, whether it's AWS Lambda or Azure Functions, is you write a single function, preferably in Python, but often they support JavaScript, C#, things like that.

00:16:00.820 --> 00:16:06.200
And that single function is the entry point into some piece of functionality.

00:16:06.200 --> 00:16:11.020
And you're going to host that function on the cloud.

00:16:11.020 --> 00:16:18.120
And it's up to the infrastructure to figure out like what Docker container to create, run that on, make that happen, scale it, etc.

00:16:18.120 --> 00:16:22.320
You just say, here's literally a Python function and its dependencies run that.

00:16:22.320 --> 00:16:24.520
So that's pretty interesting.

00:16:24.800 --> 00:16:29.900
And the main reason here that people go for this, one, is there's no server at all to maintain, not even a virtual one.

00:16:29.900 --> 00:16:32.320
And the scalability is basically infinite.

00:16:32.320 --> 00:16:34.860
And the price is like insanely cheap.

00:16:34.860 --> 00:16:38.380
Because you only pay while your function's literally executing.

00:16:38.380 --> 00:16:39.040
Okay.

00:16:39.040 --> 00:16:40.780
But I mean, there's still servers.

00:16:40.780 --> 00:16:42.120
You just don't have to set it up.

00:16:42.120 --> 00:16:42.340
Yeah.

00:16:42.340 --> 00:16:44.260
And your code is not stuck to one of them, right?

00:16:44.260 --> 00:16:47.460
Like every function call basically, I think, is a new Docker container.

00:16:47.460 --> 00:16:49.220
I'm not entirely sure about the internals.

00:16:49.220 --> 00:16:53.560
But basically, every call is like an isolated execution.

00:16:53.560 --> 00:16:54.440
And then it goes away.

00:16:54.660 --> 00:16:57.640
That's part of the appeal also is that you don't really have to care about that.

00:16:57.640 --> 00:16:58.380
Yeah, it's totally the appeal.

00:16:58.380 --> 00:17:00.220
The infrastructure just deals with it.

00:17:00.220 --> 00:17:04.600
Yeah, you do pay for a small latency on every request because it's got to like spin up this bit.

00:17:04.600 --> 00:17:12.000
But that's still for a lot of things that are not super performance critical, at least in the latency, it totally would be fine.

00:17:12.000 --> 00:17:18.160
So what I wanted to talk about this week is this thing called Chalice, a Python serverless micro framework for AWS.

00:17:18.160 --> 00:17:22.160
So basically, this is a Flask API.

00:17:22.160 --> 00:17:24.160
Another Flask API.

00:17:24.520 --> 00:17:26.060
Another Flask API.

00:17:26.060 --> 00:17:29.760
So you implement these functions in Chalice.

00:17:30.080 --> 00:17:32.720
And you decorate them with this Flask API.

00:17:33.720 --> 00:17:36.520
But instead of running a Flask app, you create a Chalice app.

00:17:36.520 --> 00:17:40.820
And then you can even say like Chalice deploy and run it.

00:17:40.820 --> 00:17:45.120
And then you just go and basically request your thing.

00:17:45.120 --> 00:17:51.620
So what you effectively create is something that looks like a Flask app with all the different pieces that are related and so on.

00:17:51.760 --> 00:17:57.900
But then they're hosted as individual function calls on the serverless infrastructure.

00:17:58.460 --> 00:17:59.460
So it's pretty cool, right?

00:17:59.460 --> 00:17:59.680
Wow.

00:17:59.680 --> 00:18:00.400
Okay, that's cool.

00:18:00.400 --> 00:18:00.520
Yeah.

00:18:00.520 --> 00:18:02.260
So I think this is really interesting.

00:18:02.260 --> 00:18:08.000
So this is just like we're going to take Flask and put it onto AWS Lambda, which is pretty cool.

00:18:08.000 --> 00:18:11.540
Maybe the other counterpart that I know pretty well is Zappa.

00:18:12.000 --> 00:18:15.380
So Zappa is, I believe, its own framework.

00:18:15.380 --> 00:18:17.380
I don't think it has a Flask variation.

00:18:17.380 --> 00:18:18.300
I could be wrong.

00:18:18.300 --> 00:18:19.300
I haven't done that much with it.

00:18:19.400 --> 00:18:28.480
But Zappa also lets you basically create this API against this website equivalent scaled out across these different functions.

00:18:28.480 --> 00:18:29.040
Yeah.

00:18:29.040 --> 00:18:30.760
So pretty cool things to be playing with.

00:18:30.760 --> 00:18:32.200
Like you don't even need cloud anymore.

00:18:32.200 --> 00:18:33.280
Now you don't even need servers.

00:18:33.280 --> 00:18:34.080
It's all serverless.

00:18:34.080 --> 00:18:35.440
Yeah.

00:18:35.440 --> 00:18:43.580
So you still, I mean, of course, you still have to set up like an AWS account and get your token or whatever to hook into this, I assume.

00:18:43.580 --> 00:18:44.440
Yeah, exactly.

00:18:44.440 --> 00:18:46.760
You've got to get your own token and all those things.

00:18:46.760 --> 00:18:55.340
And yeah, you probably are talking to like some sort of hosted database or S3 or some combination thereof to actually do your work, right?

00:18:55.340 --> 00:18:55.680
Right.

00:18:55.680 --> 00:19:02.460
And actually, so I've never worked with AWS, but these sorts of things make me kind of want to try because it doesn't look scary at all.

00:19:02.460 --> 00:19:02.800
Absolutely.

00:19:02.800 --> 00:19:04.760
So let's wrap it back to item one.

00:19:04.940 --> 00:19:18.700
When you create your Flask skill, your Ask Flask stuff, and when you work with Alexa, one of the main ways to work with Alexa is to actually tie, see?

00:19:18.700 --> 00:19:20.100
See, she's speaking to me now.

00:19:20.100 --> 00:19:25.960
To have her, you could tie those two Lambda functions, these serverless functions.

00:19:25.960 --> 00:19:27.840
So actually, you could put it all together like that.

00:19:27.840 --> 00:19:28.160
Neat.

00:19:28.260 --> 00:19:28.680
Yeah, cool.

00:19:28.680 --> 00:19:29.140
Definitely.

00:19:29.140 --> 00:19:32.880
So I think you can probably help some people with job interviews coming up here.

00:19:32.880 --> 00:19:35.280
First, how do I reverse a string?

00:19:35.280 --> 00:19:39.940
Second, what's the fastest way to uniqueify a list in Python?

00:19:39.940 --> 00:19:41.180
Reverse a string?

00:19:41.180 --> 00:19:41.880
Yes.

00:19:41.880 --> 00:19:51.620
This is a short little thing, but there's a blog article called The Fastest Way to Uniquify a List in Python greater than or equal 3.6.

00:19:51.980 --> 00:19:56.340
So basically, 3.6, unless you're running 3.7 already.

00:19:56.340 --> 00:20:01.500
I just appreciated the, instead of having just an article that says, okay, here's the answer.

00:20:01.500 --> 00:20:06.580
There is a discussion of the different ways you might do it and the code for how he timed it.

00:20:06.580 --> 00:20:13.340
So you can reproduce all of, if you don't believe it, you can reproduce all the code and get your results on your machine.

00:20:13.340 --> 00:20:14.780
It's probably similar.

00:20:14.960 --> 00:20:23.580
The short answer is, if you want to keep the order in place, you simply do a list of a dict from keys of your sequence.

00:20:23.580 --> 00:20:27.360
And we'll have this in the show notes, of course, and a link to the article.

00:20:27.360 --> 00:20:33.260
And if you don't care about the order, then just convert it to a set and then a list.

00:20:33.260 --> 00:20:35.240
So that's it.

00:20:35.560 --> 00:20:38.580
And I've used the list set before.

00:20:38.580 --> 00:20:42.220
And I was actually, I mean, it makes sense that from keys works.

00:20:42.220 --> 00:20:44.420
I've never really used that before.

00:20:44.420 --> 00:20:45.040
So that.

00:20:45.040 --> 00:20:45.280
Yeah.

00:20:45.280 --> 00:20:49.720
And it's going to get interesting with the promises of dictionaries being ordered.

00:20:49.720 --> 00:20:53.300
You could actually get some of these to be a little quicker, right?

00:20:53.300 --> 00:20:54.440
But still preserving the order.

00:20:54.440 --> 00:20:56.860
Well, isn't that the way it is now?

00:20:56.860 --> 00:20:57.440
Not all.

00:20:57.440 --> 00:21:02.860
Like some of them, there's like two graphs that says not order preserving functions and then order preserving functions.

00:21:03.460 --> 00:21:07.760
And right now they have list of set of list.

00:21:07.760 --> 00:21:09.600
Not order preserving.

00:21:09.600 --> 00:21:10.120
Right.

00:21:10.120 --> 00:21:12.540
Because set isn't an order preserving thing.

00:21:12.540 --> 00:21:13.080
So, yeah.

00:21:13.080 --> 00:21:13.860
But it's pretty cool, though.

00:21:13.860 --> 00:21:14.400
Pretty cool.

00:21:14.400 --> 00:21:18.940
Definitely worth thinking about all the different ways and seeing the tradeoffs and so on.

00:21:18.940 --> 00:21:19.200
Okay.

00:21:19.200 --> 00:21:19.600
All right.

00:21:19.600 --> 00:21:22.580
So I want to wrap up this episode with leaving some people with homework.

00:21:22.580 --> 00:21:28.140
They've got some research and some chilling on the couch watching some Python videos.

00:21:28.140 --> 00:21:28.520
Okay.

00:21:28.680 --> 00:21:33.320
So there's two sets of conference videos that came out.

00:21:33.320 --> 00:21:34.680
And I'm sure there's some that I've missed.

00:21:34.680 --> 00:21:36.560
But these are the two that stood out to me recently.

00:21:36.560 --> 00:21:42.140
Pi Texas and PiCon Australia both have their videos up.

00:21:42.140 --> 00:21:46.560
And I linked to the playlist on YouTube for both of them, which is pretty cool.

00:21:46.560 --> 00:21:49.920
There's, you know, like always like 40 or more videos.

00:21:49.920 --> 00:21:51.680
There's tons of really interesting stuff.

00:21:51.680 --> 00:21:57.140
But I kind of wanted to touch on some that I, these are not necessarily endorsements.

00:21:57.140 --> 00:21:59.040
These are just like, these look really interesting to me.

00:21:59.040 --> 00:22:00.060
And I'd like to go watch them.

00:22:00.060 --> 00:22:03.640
I haven't spent all this time watching all these videos just right now.

00:22:03.640 --> 00:22:07.620
But from Pi Texas, there's a talk on MicroPython.

00:22:07.620 --> 00:22:10.280
Which MicroPython is really, really cool.

00:22:10.280 --> 00:22:10.540
Right?

00:22:10.580 --> 00:22:18.100
You can run your Python on like a $5 microchip and hook your Lambda functions, your Python ones, up to like hardware interrupts.

00:22:18.100 --> 00:22:19.160
Like that's just the coolest.

00:22:19.160 --> 00:22:24.160
And then there's so much talk about machine learning and AI and all that stuff.

00:22:24.160 --> 00:22:28.360
So there was a talk given there called, What is Machine Learning Anyway?

00:22:28.360 --> 00:22:29.960
Or something like that.

00:22:29.960 --> 00:22:33.580
So like a foundational background on machine learning, which is cool.

00:22:33.680 --> 00:22:37.360
And another one is C for yourself with the letter C, not S-E-E.

00:22:37.360 --> 00:22:40.420
So like trying to explore the internals of CPython.

00:22:40.420 --> 00:22:46.420
And then there's one on Python and .NET for this thing called Python.NET, which is not the Iron Python that's been around for a long time.

00:22:46.420 --> 00:22:49.400
But like this newer way to try to integrate those things.

00:22:49.400 --> 00:22:54.920
So all the people that work on the big enterprise apps in C#, they can now plug in some sweet Python or vice versa.

00:22:54.920 --> 00:22:55.440
Yeah.

00:22:55.440 --> 00:22:55.880
Okay.

00:22:55.880 --> 00:22:59.180
Those all look good to me too, especially the MicroPython.

00:22:59.180 --> 00:22:59.460
Yeah.

00:22:59.460 --> 00:23:00.560
The MicroPython is great.

00:23:00.560 --> 00:23:01.360
So that's in Texas.

00:23:01.360 --> 00:23:02.320
And then Australia.

00:23:02.320 --> 00:23:03.400
I don't know.

00:23:03.480 --> 00:23:04.980
Those guys were killing it with names down there.

00:23:04.980 --> 00:23:06.300
They just really did a good job.

00:23:06.300 --> 00:23:06.920
And there's so many.

00:23:06.920 --> 00:23:08.500
I have more I pulled out.

00:23:08.500 --> 00:23:09.180
So I'll go a little quicker.

00:23:09.180 --> 00:23:10.500
Gradual typing.

00:23:10.500 --> 00:23:11.220
Right?

00:23:11.220 --> 00:23:13.880
We've talked about that, the typings and adding them and stuff.

00:23:13.880 --> 00:23:16.660
And I think this is probably a really interesting survey that.

00:23:16.660 --> 00:23:19.760
Hot reloading Python web servers at scale.

00:23:19.760 --> 00:23:21.220
Ooh, that sounds nice.

00:23:21.220 --> 00:23:21.740
Yeah.

00:23:21.740 --> 00:23:23.140
That sounds like a lot of cool internals.

00:23:23.140 --> 00:23:25.980
Prototyping Python microservices in production.

00:23:25.980 --> 00:23:31.160
And secrets of a WSGI master, like understanding the base HTTP protocol.

00:23:31.160 --> 00:23:33.060
And then another one.

00:23:33.280 --> 00:23:35.640
Python 3 for people who have not been paying attention.

00:23:35.640 --> 00:23:40.060
So that's not anybody that's listening to this.

00:23:40.060 --> 00:23:40.600
Exactly.

00:23:40.600 --> 00:23:42.160
They know about legacy Python.

00:23:42.160 --> 00:23:42.660
Come on.

00:23:42.660 --> 00:23:44.320
Then identity 2.0.

00:23:44.320 --> 00:23:48.000
What, what, why, and how of social and federated logins.

00:23:48.000 --> 00:23:51.860
So if you've got to do anything with like identity across providers, that's so painful.

00:23:51.860 --> 00:23:52.540
This would be cool.

00:23:53.020 --> 00:23:56.000
And then here's a sort of a Tesla reference.

00:23:56.000 --> 00:23:59.200
I'm guessing Python ludicrous mode with Django.

00:23:59.200 --> 00:24:04.120
So ludicrous mode in the Teslas is like, you know, like the insane amount of power.

00:24:04.120 --> 00:24:07.880
Like, you know, give you a neck ache if you hit the gas yard sort of thing.

00:24:07.960 --> 00:24:09.380
So something to that effect.

00:24:09.380 --> 00:24:12.880
And then finally, scaling down.

00:24:12.880 --> 00:24:16.420
We often talk about scale up and all this complexity you got to deal with.

00:24:16.420 --> 00:24:18.240
You even talked about how you're not Google.

00:24:18.240 --> 00:24:21.200
You're not Facebook or any of these things a while back, which was cool.

00:24:21.380 --> 00:24:26.320
But this is, if you do have one of these large sites that's got a complicated architecture,

00:24:26.320 --> 00:24:32.620
let's say a Redis back-end message queue type thing and a database and a whole bunch of other

00:24:32.620 --> 00:24:34.600
stuff, maybe some of those are hosted in the cloud.

00:24:34.600 --> 00:24:37.540
Like, how do you actually develop that locally also?

00:24:37.540 --> 00:24:38.480
That's cool.

00:24:38.480 --> 00:24:41.480
That's definitely a need for everyone, I think.

00:24:41.480 --> 00:24:42.920
I'm sure there's a lot of good lessons in there.

00:24:42.920 --> 00:24:47.260
So the links to both of those playlists are up on the show notes.

00:24:47.260 --> 00:24:47.900
So that should be fun.

00:24:47.900 --> 00:24:48.800
All right, cool.

00:24:48.800 --> 00:24:49.160
All right.

00:24:49.160 --> 00:24:49.840
Well, how about you?

00:24:49.840 --> 00:24:51.580
Any other news?

00:24:51.580 --> 00:24:52.520
We're out.

00:24:52.520 --> 00:24:54.620
So that was six.

00:24:54.620 --> 00:24:54.860
Cool.

00:24:54.860 --> 00:24:55.160
Cool.

00:24:55.160 --> 00:24:57.260
You've actually been crushing it lately.

00:24:57.260 --> 00:24:59.280
I've been so busy.

00:24:59.280 --> 00:25:00.220
It's been so fun, though.

00:25:00.220 --> 00:25:01.400
Yeah.

00:25:01.400 --> 00:25:05.000
So last week, I released my Everything Bundle where people can get all the courses, right?

00:25:05.000 --> 00:25:10.040
And so I shipped my first course for that Everything Bundle called Mastering PyCharm,

00:25:10.040 --> 00:25:16.980
which, yes, it covers PyCharm, but it's also basically like a little mini course on like 16

00:25:16.980 --> 00:25:19.000
different parts of software development.

00:25:19.000 --> 00:25:23.940
So there's like a little tiny 20 minute thing on refactoring and a 15 minute thing on unit

00:25:23.940 --> 00:25:24.860
testing and pytest.

00:25:24.860 --> 00:25:25.260
Okay.

00:25:25.260 --> 00:25:27.220
30 minute thing on Git and stuff.

00:25:27.220 --> 00:25:31.200
So it's like sort of all those little pieces put together, but through the lens of working

00:25:31.200 --> 00:25:31.860
with PyCharm.

00:25:31.860 --> 00:25:33.300
So I'll link to that.

00:25:33.300 --> 00:25:36.480
And yeah, people can check that out if they want.

00:25:37.340 --> 00:25:40.360
And I'm also doing a webcast with the JetBrains people, but on MongoDB.

00:25:40.360 --> 00:25:45.440
So if they want to, people want to drop in on that on January 30th, I'm doing a live event

00:25:45.440 --> 00:25:48.360
with JetBrains and the link for that registration will be there.

00:25:48.360 --> 00:25:48.740
It's free.

00:25:48.740 --> 00:25:49.780
You can come check it out.

00:25:49.780 --> 00:25:50.100
Cool.

00:25:50.100 --> 00:25:51.080
I'll come watch.

00:25:51.080 --> 00:25:51.400
All right.

00:25:51.400 --> 00:25:51.700
Awesome.

00:25:51.700 --> 00:25:54.400
Well, yeah, that's all I've been doing this week.

00:25:54.400 --> 00:25:54.900
Nice.

00:25:56.480 --> 00:25:56.760
Great.

00:25:56.760 --> 00:25:57.000
All right.

00:25:57.000 --> 00:25:57.780
Well, thank you, Brian.

00:25:57.780 --> 00:25:58.280
Thank you.

00:25:58.280 --> 00:25:59.500
A lot of good stuff this week.

00:25:59.500 --> 00:25:59.740
Yeah.

00:25:59.740 --> 00:26:01.960
And looking forward to more next.

00:26:01.960 --> 00:26:02.860
Talk to you next week.

00:26:02.860 --> 00:26:03.260
All right.

00:26:03.260 --> 00:26:03.420
Bye.

00:26:04.160 --> 00:26:05.900
Thank you for listening to Python Bytes.

00:26:05.900 --> 00:26:08.480
Follow the show on Twitter via at Python Bytes.

00:26:08.480 --> 00:26:11.360
That's Python Bytes as in B-Y-T-E-S.

00:26:11.360 --> 00:26:14.800
And get the full show notes at pythonbytes.fm.

00:26:14.800 --> 00:26:19.120
If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

00:26:19.120 --> 00:26:21.840
We're always on the lookout for sharing something cool.

00:26:21.840 --> 00:26:25.220
On behalf of myself and Brian Okken, this is Michael Kennedy.

00:26:25.220 --> 00:26:28.840
Thank you for listening and sharing this podcast with your friends and colleagues.

