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:11.140
This is episode 97, recorded September 26, 2018. I'm Michael Kennedy.

00:00:11.140 --> 00:00:12.080
And I'm Brian Okken.

00:00:12.080 --> 00:00:13.260
Hey, Brian. How are you doing today?

00:00:13.260 --> 00:00:14.900
Hey, I'm doing great.

00:00:14.900 --> 00:00:19.160
Awesome. Awesome. Me too. Lots of big news. So much news that I can't even keep up with it.

00:00:19.160 --> 00:00:23.660
Yeah, it's a good thing that there's like this weekly podcast that keeps us up on Python news.

00:00:23.660 --> 00:00:25.700
I know. Where's the one that we get to listen to?

00:00:25.700 --> 00:00:27.640
Yeah.

00:00:27.640 --> 00:00:29.380
That's what we need. We need a meta podcast.

00:00:29.660 --> 00:00:32.160
No, that's okay. Other people don't do that.

00:00:32.160 --> 00:00:32.800
Yeah, that's right.

00:00:32.800 --> 00:00:37.360
So I also want to say thank you to Datadog for sponsoring this episode.

00:00:37.360 --> 00:00:41.740
Really happy to have them on board. Check them out at pythonbytes.fm/datadog.

00:00:41.740 --> 00:00:46.080
Cool t-shirt lives at that URL. More to say about that later.

00:00:46.080 --> 00:00:48.760
PyPI just keeps getting better and better, doesn't it?

00:00:48.760 --> 00:00:51.680
Yeah, PyPI keeps getting better and the tools around it.

00:00:51.680 --> 00:00:56.680
And a recent release just a couple days ago of Twine.

00:00:57.480 --> 00:00:58.840
So Twine has been updated.

00:00:58.840 --> 00:01:10.360
And for people that don't know, Twine is the thing that pushes your code from your laptop or your computer or your server or wherever to PyPI.

00:01:11.100 --> 00:01:13.780
And Twine has a check function now.

00:01:13.780 --> 00:01:17.200
Actually, there's quite a few things in the new Twine upgrade.

00:01:17.560 --> 00:01:28.220
But this one's neat because once you've packaged your distribution up and everything and your wheels and whatever, it usually shows up in a dist folder.

00:01:28.220 --> 00:01:32.080
And then you say Twine check dist and then everything in it.

00:01:32.500 --> 00:01:42.400
And it checks to make sure that one of the things it does, I think it does a lot of things, but at the very least, one of the things it does is make sure your readme is rendering properly, supposedly.

00:01:42.400 --> 00:01:45.080
Yeah, that's really cool that it even checks that, right?

00:01:45.080 --> 00:01:47.680
Because that's hard to test, right?

00:01:47.680 --> 00:01:50.060
How do you know if your readme is not rendering properly?

00:01:50.060 --> 00:02:00.320
Yeah, we're linking to an article that's from on the PyPI that is how to make a PyPI-friendly readme.

00:02:00.320 --> 00:02:08.900
So there's actually, it's not really difficult, but it's one of those things that, it's one of the last things you do before you, well, it shouldn't be the last thing.

00:02:09.020 --> 00:02:16.680
But when you're getting a package together and you're like, hey, I have this really cool idea, I want to push it up on PyPI, you got to make sure the readme works.

00:02:16.680 --> 00:02:19.340
And this is one of those steps.

00:02:19.340 --> 00:02:22.320
And there's just a little short article on how to do that right.

00:02:22.320 --> 00:02:22.720
Yeah.

00:02:22.720 --> 00:02:28.020
Although like magic, it's not difficult, but the stuff you have to put in your setup.py and everything.

00:02:28.020 --> 00:02:29.160
Yeah, that's a good find.

00:02:29.160 --> 00:02:34.220
Anyone who is either maintaining or thinking of creating a PyPI package should definitely check it out.

00:02:34.300 --> 00:02:44.580
Yeah, and I think in your build toolchain or your talks toolchain to add a check step to make sure to go ahead and check before pushing it up, that would be a good thing to do.

00:02:44.580 --> 00:02:46.300
That can be like a pre-commit hook or something.

00:02:46.300 --> 00:02:47.000
Wow.

00:02:47.000 --> 00:02:47.420
I don't know.

00:02:47.420 --> 00:02:50.680
Definitely part of your continuous integration anyway.

00:02:50.680 --> 00:02:52.160
Yeah, definitely part of your CI.

00:02:52.160 --> 00:02:54.720
The first item I have is pretty interesting.

00:02:55.500 --> 00:03:08.280
And when you think of the languages and technologies that you can use, most of the time we think of programming languages and their subsequent runtimes basically being free, right?

00:03:08.280 --> 00:03:09.620
I mean, obviously Python.

00:03:09.620 --> 00:03:12.440
Like you don't think, well, what does CPython cost?

00:03:12.440 --> 00:03:16.280
But even from places where you might not necessarily expect it, right?

00:03:16.280 --> 00:03:18.660
Like C++, it's free.

00:03:18.660 --> 00:03:19.860
Go is free.

00:03:19.860 --> 00:03:22.240
Microsoft.net is free.

00:03:22.240 --> 00:03:22.720
Right?

00:03:22.720 --> 00:03:23.340
All these things.

00:03:23.340 --> 00:03:24.920
You know what's not free these days?

00:03:25.060 --> 00:03:25.280
What?

00:03:25.280 --> 00:03:25.640
Java.

00:03:25.640 --> 00:03:26.080
Really?

00:03:26.080 --> 00:03:49.960
So apparently, Sun has made the Java runtime for, you're going to have to just check out the article on the register to make sure I get this exactly right, but roughly, Java is making the runtime a subscription, and the subscription costs $25 per processor per month for commercial entities.

00:03:49.960 --> 00:03:50.920
Wow.

00:03:50.920 --> 00:03:51.780
Is that crazy?

00:03:51.780 --> 00:03:52.340
Yeah.

00:03:52.340 --> 00:03:57.580
There's definitely some cases, like as students and whatnot, where you can just use Java for free.

00:03:57.580 --> 00:04:09.900
But a lot of commercial organizations that depend upon Java need to read this article and the subsequently linked 330-page document that describes this process over at Oracle.

00:04:09.900 --> 00:04:10.300
Hmm.

00:04:10.500 --> 00:04:11.760
So that's pretty interesting, right?

00:04:11.760 --> 00:04:12.260
Yeah.

00:04:12.260 --> 00:04:12.380
Yeah.

00:04:12.380 --> 00:04:12.420
Yeah.

00:04:12.420 --> 00:04:12.420
Yeah.

00:04:12.420 --> 00:04:12.480
Yeah.

00:04:12.480 --> 00:04:12.500
Yeah.

00:04:12.500 --> 00:04:12.500
Yeah.

00:04:12.500 --> 00:04:12.500
Yeah.

00:04:12.500 --> 00:04:12.880
Yeah.

00:04:12.880 --> 00:04:13.800
It's the run times even.

00:04:13.800 --> 00:04:20.220
So you have to, like, if somebody else makes a Java application, it's not the person making it, it's the person running it.

00:04:20.220 --> 00:04:20.500
Yeah.

00:04:20.500 --> 00:04:20.540
Yeah.

00:04:20.540 --> 00:04:26.020
So it says, Oracle's put a price on the Java SE and its subsequent support.

00:04:26.020 --> 00:04:32.660
So $25 per processor per month plus a $2.50 per user per month on the desktop.

00:04:32.660 --> 00:04:33.060
Okay.

00:04:33.200 --> 00:04:34.220
Unless you buy a whole bunch.

00:04:34.220 --> 00:04:34.660
Yeah.

00:04:34.660 --> 00:04:36.460
So it looks like maybe $250.

00:04:36.460 --> 00:04:37.460
Wow.

00:04:37.460 --> 00:04:37.920
Yeah.

00:04:37.920 --> 00:04:41.920
It's kind of all convoluted, but it's, yeah, it's quite interesting.

00:04:41.920 --> 00:04:53.340
They say the older run times, you can still use them for free, but, like, who wants to use a run time that has no bug fixes, no security patches or things like that, right?

00:04:53.560 --> 00:04:58.300
Yeah, I guess maybe they're trying to make everybody move to Python.

00:04:58.300 --> 00:04:58.640
Yeah.

00:04:58.640 --> 00:05:00.360
And that's exactly, that was my first thought.

00:05:00.360 --> 00:05:02.880
It's like, yeah, Java's been pretty high in the language rankings.

00:05:02.880 --> 00:05:04.120
Maybe it's going to plummet now.

00:05:04.120 --> 00:05:06.220
I mean, seriously, this is pretty crazy.

00:05:06.220 --> 00:05:11.120
So, yeah, it says, also, there's a little bit of a stick to go with the carrot.

00:05:11.120 --> 00:05:12.100
Yeah.

00:05:12.100 --> 00:05:18.380
Come January 2019, Java SE 8 on the desktop won't be updated anymore unless you buy a subscription.

00:05:19.520 --> 00:05:28.040
And, yeah, the short version is every commercial enterprise needs to look at their Java standard edition usage to see if they have something to do with licensing now.

00:05:28.040 --> 00:05:34.820
So this was sent in by one of our listeners, and I'm super sorry I didn't write down the name in the show notes, but thank you for sending it in.

00:05:34.820 --> 00:05:35.840
This is interesting.

00:05:35.840 --> 00:05:39.640
I know it's not directly a Python thing, but it's just, you know, here's the thing.

00:05:39.640 --> 00:05:47.300
I kind of always sort of thought of Java as more or less open source, and I guess it's just, you know, that Oracle oversaw, but I guess that's not the case.

00:05:47.300 --> 00:05:47.740
Yeah.

00:05:47.740 --> 00:05:48.340
Weird.

00:05:48.340 --> 00:05:49.020
Okay.

00:05:49.020 --> 00:05:49.200
Yeah.

00:05:49.200 --> 00:05:51.160
Anyway, there's that.

00:05:51.160 --> 00:05:51.680
Yeah.

00:05:51.680 --> 00:05:54.340
Well, this next topic is really, really important.

00:05:54.340 --> 00:05:55.580
For importing.

00:05:55.580 --> 00:05:56.640
Importing.

00:05:56.640 --> 00:05:56.940
Yeah.

00:05:56.940 --> 00:05:58.340
It's very, very importing.

00:05:58.340 --> 00:06:00.880
Tell us about it.

00:06:00.880 --> 00:06:01.200
Importing.

00:06:01.200 --> 00:06:01.520
Yeah.

00:06:01.520 --> 00:06:04.940
Absolute versus relative imports in Python.

00:06:04.940 --> 00:06:07.520
This is an article on the real Python.

00:06:07.520 --> 00:06:08.680
I think it's on real Python.

00:06:08.680 --> 00:06:10.360
Realpython.com.

00:06:10.360 --> 00:06:11.860
There's a lot of great articles there.

00:06:11.860 --> 00:06:12.280
Yeah.

00:06:12.280 --> 00:06:13.380
I like what they're doing.

00:06:13.380 --> 00:06:13.920
Great job over there.

00:06:13.920 --> 00:06:14.680
Me too.

00:06:14.680 --> 00:06:23.260
The relative, and I lost my tab, but the most of your imports are going to be, the first part of the article is talking about normal kinds of imports.

00:06:23.260 --> 00:06:27.680
Like just the, you know, you import a package, like the import statement.

00:06:27.680 --> 00:06:28.200
Right.

00:06:28.200 --> 00:06:33.860
You do from package import something or from package dot, some sub package.

00:06:33.860 --> 00:06:35.780
There's a lot of, there's a lot of versions of that.

00:06:35.780 --> 00:06:37.720
So it's covering that.

00:06:37.720 --> 00:06:43.240
But there's, like for instance, there's relative imports, which includes dots.

00:06:43.740 --> 00:06:47.080
So, like from dot, import something.

00:06:47.080 --> 00:06:49.700
Or import dot something.

00:06:49.700 --> 00:06:53.480
And I never, I kind of never remember how all that works.

00:06:53.480 --> 00:06:55.180
So I'm glad that somebody wrote it up.

00:06:55.180 --> 00:07:00.520
I know it could probably find its other places, but this is a nice write-up of what all this means.

00:07:00.520 --> 00:07:04.840
So in general, people say the recommendation is don't do this.

00:07:04.840 --> 00:07:06.220
Don't do relative imports.

00:07:06.220 --> 00:07:09.260
But sometimes you have to, and there's a lot of good times.

00:07:09.260 --> 00:07:18.680
So for instance, if you were a package maintainer or you're developing a package, the modules within the package should be able to use functions from other modules.

00:07:18.680 --> 00:07:19.740
That's why you have them.

00:07:19.740 --> 00:07:21.220
But how do you import that?

00:07:21.220 --> 00:07:28.040
You don't just, and one of the ways is you, you know, from dot, neighbor module, import something.

00:07:28.040 --> 00:07:34.340
And that's what the single dot is, is import a module from the same package you're already at relatively.

00:07:34.340 --> 00:07:35.140
Yeah, that's cool.

00:07:35.140 --> 00:07:48.460
You know, the other thing that bugs me about when you have a package and sub packages that all interact and you use the full or external import style, if you want to rename that package, you're like, oh, I kind of like would rather call it this.

00:07:48.460 --> 00:07:51.620
All of a sudden, there's like lots of pain and suffering that happens.

00:07:51.620 --> 00:07:52.100
Yeah.

00:07:52.100 --> 00:07:58.040
Well, even within it, if you import it from the top, yeah, you have to go through and change it.

00:07:58.040 --> 00:07:58.420
I don't know.

00:07:58.420 --> 00:07:59.160
Yeah, exactly.

00:07:59.160 --> 00:08:03.640
It's not something I see very much, but I think it's a great article to have it all written up.

00:08:03.640 --> 00:08:05.660
Yeah, well, I use the dot, dot.

00:08:05.660 --> 00:08:07.820
I guess it's a parent package thing.

00:08:07.820 --> 00:08:08.800
I don't really use that.

00:08:08.800 --> 00:08:15.660
But the single dot, I use all the time to just say the import something from the same package I'm in to keep.

00:08:15.660 --> 00:08:21.520
That way, like you said, you don't have to, if you decide on a different name for your package, you don't need to change that.

00:08:21.520 --> 00:08:22.240
Yeah, absolutely.

00:08:22.240 --> 00:08:22.760
Very nice.

00:08:22.760 --> 00:08:23.700
So this is a good write-up.

00:08:23.700 --> 00:08:23.920
Yeah.

00:08:24.300 --> 00:08:29.000
So before we get to the next one, which is kind of retro and fun, let me tell you quickly about Datadog.

00:08:29.000 --> 00:08:30.820
If you're not familiar with them, you should check them out.

00:08:30.820 --> 00:08:34.820
They're especially good for distributed systems, microservices, things like that.

00:08:34.820 --> 00:08:39.460
So they're a monitoring platform that brings together metrics, logs, request traces, all in one place.

00:08:39.540 --> 00:08:53.040
Datadog has a trace as search and analytics feature that lets you break down your Python app performance by user, by URL, all sorts of cool stuff like that.

00:08:53.160 --> 00:08:57.040
So you can quickly, easily troubleshoot and optimize your Python app.

00:08:57.040 --> 00:09:03.860
So try that out today with a free trial and Datadog will send you a free cool dog t-shirt.

00:09:03.860 --> 00:09:04.460
It's very nice.

00:09:04.460 --> 00:09:07.220
Check them out at pythonbytes.fm/Datadog to get started.

00:09:07.220 --> 00:09:10.940
The user ID thing, searching on users is kind of cool.

00:09:10.940 --> 00:09:16.900
You could maybe line that up if like a particular user had a complaint or something, you could maybe use that.

00:09:16.900 --> 00:09:17.740
Exactly.

00:09:17.740 --> 00:09:19.080
I get this all the time.

00:09:19.080 --> 00:09:22.000
Like, oh, this thing is not working super well on your platform.

00:09:22.000 --> 00:09:24.780
I'm like, seems to be working pretty well.

00:09:24.780 --> 00:09:25.980
I just don't understand.

00:09:25.980 --> 00:09:28.760
But if I could actually dig into it by user ID, that'd be awesome.

00:09:28.760 --> 00:09:30.000
Yeah, that's cool.

00:09:30.000 --> 00:09:30.480
Yeah.

00:09:30.480 --> 00:09:32.660
So I promise to do something retro, right?

00:09:32.660 --> 00:09:33.380
Yeah.

00:09:33.380 --> 00:09:34.560
I love retro.

00:09:34.560 --> 00:09:35.500
Quite retro.

00:09:35.500 --> 00:09:36.660
Yeah.

00:09:36.660 --> 00:09:44.240
So you should check out, if you feel like making a game, you know, a lot of people get into programming because they were interested in making games.

00:09:44.240 --> 00:09:45.460
And that's why they got into programming.

00:09:45.460 --> 00:09:46.440
That was not me, actually.

00:09:46.440 --> 00:09:48.580
Like, I enjoyed playing games when I was younger.

00:09:48.580 --> 00:09:50.180
I sometimes still do.

00:09:50.180 --> 00:09:53.620
But I wasn't like, oh, I have to go into computers so I can make a game.

00:09:53.620 --> 00:09:54.480
I know a lot of people did.

00:09:54.480 --> 00:10:04.220
But the reality of make a game now is get 100 of your, you know, highly skilled developers and artists friends together and work for a year, which doesn't make a lot of sense, right?

00:10:04.220 --> 00:10:04.460
Yeah.

00:10:04.540 --> 00:10:07.540
So you might make like a cool 2D scroll or retro thing.

00:10:07.540 --> 00:10:15.320
And this thing called Pyxel, P-Y-X-E-L, like pixel, Python, pixel sort of thing, is a retro game engine for Python.

00:10:15.320 --> 00:10:15.960
How fun.

00:10:16.060 --> 00:10:17.820
So the idea is you only get 16 colors.

00:10:17.820 --> 00:10:21.760
You get four sounds that can be played at the same time.

00:10:21.760 --> 00:10:25.500
It's a Python 3 run game platform.

00:10:25.500 --> 00:10:29.180
It runs on all the major platforms, Windows, macOS, and Linux.

00:10:29.180 --> 00:10:31.720
It even comes with a bunch of cool examples.

00:10:31.720 --> 00:10:35.320
So if you pip install it, then you can just run install Pyxel examples.

00:10:35.320 --> 00:10:37.880
And then you can go and explore them.

00:10:37.880 --> 00:10:38.720
But what do you think?

00:10:38.720 --> 00:10:39.940
Looking at some of the screenshots there.

00:10:40.060 --> 00:10:41.280
It looks kind of fun.

00:10:41.280 --> 00:10:43.100
I got to try to check this out.

00:10:43.100 --> 00:10:43.340
Yeah.

00:10:43.340 --> 00:10:47.880
You don't have to be like massively skilled to create the graphics because you only get like a few colors.

00:10:47.880 --> 00:10:50.420
You only get like a certain size.

00:10:50.420 --> 00:10:56.420
It's not, you know, you don't have to be crazy artistic game studio type place to make this.

00:10:56.420 --> 00:10:56.640
Yeah.

00:10:56.640 --> 00:10:58.900
These are the types of video games that I grew up on.

00:10:58.900 --> 00:10:59.880
So yeah.

00:10:59.880 --> 00:11:00.540
Yeah.

00:11:00.540 --> 00:11:01.700
I think people might enjoy this.

00:11:01.700 --> 00:11:04.000
And like I said, I think it makes it pretty accessible.

00:11:04.660 --> 00:11:19.480
It's an interesting way to bring UI capabilities to Python for people who might want to, like if you are doing some sort of programming class or you're doing, you know, like a school club or an hour of code type of thing.

00:11:19.480 --> 00:11:20.760
An hour of code is probably too short.

00:11:20.760 --> 00:11:31.800
But, you know, those types of projects where you want to let, especially kids who are impatient and don't care that much for terminal apps and are not ready for web apps, like they could build a fun little thing if you gave them this as a foundation.

00:11:31.800 --> 00:11:32.180
Yeah.

00:11:32.180 --> 00:11:33.200
Each house.

00:11:33.200 --> 00:11:33.840
So cool.

00:11:33.940 --> 00:11:34.020
Yeah.

00:11:34.020 --> 00:11:36.180
If people are into retro games, check this out.

00:11:36.180 --> 00:11:37.500
You can create your own with Python.

00:11:37.500 --> 00:11:39.600
What if I don't want to create a game?

00:11:39.600 --> 00:11:41.800
I just want to create a command line interface.

00:11:41.800 --> 00:11:43.280
You mean like most apps?

00:11:43.280 --> 00:11:43.460
Yeah.

00:11:43.460 --> 00:11:48.640
So that's, you could even make your game have command line interfaces.

00:11:48.640 --> 00:11:49.400
Yeah.

00:11:49.400 --> 00:11:50.740
So there's a couple of options, right?

00:11:50.740 --> 00:11:52.280
You could use sys.argv.

00:11:52.280 --> 00:11:53.560
That'd be pretty awesome.

00:11:53.560 --> 00:11:54.600
That's pretty extensible.

00:11:54.600 --> 00:12:00.160
You could also use higher level things like argparse or click, right?

00:12:00.160 --> 00:12:00.860
Click.

00:12:00.860 --> 00:12:01.320
Yeah.

00:12:01.320 --> 00:12:01.560
Yeah.

00:12:01.560 --> 00:12:02.140
What's up with click?

00:12:02.320 --> 00:12:05.900
I know there's a lot of great options and sometimes you just reach for what you know.

00:12:05.980 --> 00:12:13.680
And since I've written a few command line interfaces from the sys.args and not enjoyed it, I have enjoyed working with click.

00:12:14.020 --> 00:12:15.500
And so click's been around for a while.

00:12:15.500 --> 00:12:22.940
But the news, really, I wanted to highlight it because it's cool that the click version 7 was released recently.

00:12:23.280 --> 00:12:36.760
And there's a huge list of, I mean, normally we don't just cover a version update of something just for the heck of it because things update all the time.

00:12:36.760 --> 00:12:39.040
Except for click doesn't update all the time.

00:12:39.040 --> 00:12:43.380
The last version of click was released January of 2017.

00:12:44.240 --> 00:12:46.780
So that's neat that we have a new one.

00:12:46.780 --> 00:12:49.280
So there's all sorts of fun stuff in here.

00:12:49.280 --> 00:12:51.200
I don't know what I'm really excited about.

00:12:51.200 --> 00:12:54.840
There's ZShell auto-completion support that was added.

00:12:54.840 --> 00:12:56.280
That's kind of neat.

00:12:56.280 --> 00:12:57.060
That is quite cool.

00:12:57.060 --> 00:12:59.580
I use ohmyzsh, which I love.

00:12:59.580 --> 00:13:03.160
And this is really exciting for me because it's based on ZShell.

00:13:03.280 --> 00:13:07.620
One of the other things is click interfaces have, they include a help option.

00:13:07.620 --> 00:13:14.400
You can do --help and it tells you what the options are for your command line interface and how to call it.

00:13:14.400 --> 00:13:17.380
You have to build that sort of stuff in, but it's pretty easy to write up.

00:13:17.380 --> 00:13:22.940
But one of the things they've added is that if you do it wrong, it doesn't tell you, it just says this is wrong or something.

00:13:22.940 --> 00:13:25.400
It doesn't tell you, it doesn't point to the help.

00:13:25.400 --> 00:13:26.880
But now it does.

00:13:26.880 --> 00:13:32.480
So in this version, any usage errors will now hint at using the help option, which is cool.

00:13:32.720 --> 00:13:33.500
Yeah, I like it.

00:13:33.500 --> 00:13:36.180
And actually, there's pages and pages and pages of updates.

00:13:36.180 --> 00:13:37.660
There's a lot of stuff that changed.

00:13:37.660 --> 00:13:39.220
So good job, folks.

00:13:39.220 --> 00:13:45.780
And I didn't realize it was part of the Palettes project, which is also Flask, the people that work on Flask.

00:13:45.780 --> 00:13:47.260
Yeah, yeah, it's part of Palettes.

00:13:47.260 --> 00:13:51.360
And you talked about how it hasn't been updated in a while and this is a major release.

00:13:51.360 --> 00:13:54.800
Like Flask just went 1.0 and we talked about that a little while ago as well.

00:13:54.800 --> 00:13:55.420
That's pretty awesome.

00:13:55.420 --> 00:13:55.900
Yeah.

00:13:55.900 --> 00:14:02.700
And I know that the Palettes people, they take donations for if you're utilizing this and want to help out.

00:14:02.700 --> 00:14:03.880
They would love to have your money.

00:14:03.880 --> 00:14:05.140
They would.

00:14:05.140 --> 00:14:05.560
They would.

00:14:05.560 --> 00:14:09.340
They have a special arrangement with the PSF.

00:14:09.340 --> 00:14:11.780
So it's sort of a nonprofit thing as well somehow, I think.

00:14:11.780 --> 00:14:12.180
Yeah.

00:14:12.180 --> 00:14:13.460
And nice people too.

00:14:13.460 --> 00:14:14.280
Yep, absolutely.

00:14:14.280 --> 00:14:15.680
So this is cool.

00:14:15.680 --> 00:14:16.800
I'm glad you highlighted it.

00:14:16.800 --> 00:14:19.440
I want to understand the ZSH autocomplete a little bit more.

00:14:19.440 --> 00:14:19.880
That's sweet.

00:14:19.880 --> 00:14:22.040
So, Brian, do you use the cloud much?

00:14:22.040 --> 00:14:23.120
I think so.

00:14:23.120 --> 00:14:25.160
Well, we live in Oregon, so we get lots of clouds.

00:14:25.160 --> 00:14:25.600
Oh, yeah.

00:14:25.600 --> 00:14:27.640
We, like, definitely use the cloud at least half the year.

00:14:27.640 --> 00:14:29.360
Yeah.

00:14:29.360 --> 00:14:31.280
No, so.

00:14:31.280 --> 00:14:33.380
That was a really bad joke.

00:14:33.380 --> 00:14:34.540
It's a pretty good one.

00:14:34.540 --> 00:14:35.180
Yeah, I liked it.

00:14:35.180 --> 00:14:51.200
So one of the challenges of especially, like, platform as a service and things that are not infrastructure but other stuff, database as a service and other higher order things, is that you often pay, like, as you use them.

00:14:51.400 --> 00:14:51.600
Right?

00:14:51.600 --> 00:14:55.680
And, like, if I use a virtual machine, I turn on the virtual machine, I know what it costs.

00:14:55.680 --> 00:14:55.960
Right?

00:14:55.960 --> 00:14:58.900
Like, I go to DigitalOcean, fire that thing up.

00:14:58.900 --> 00:15:02.580
I know, like, the server that runs Python Bytes plus the database server.

00:15:02.580 --> 00:15:05.180
I think they cost $15 a month together.

00:15:05.180 --> 00:15:05.480
Right?

00:15:05.480 --> 00:15:09.360
I know it's $15 pretty much other than bandwidth, which is mostly covered.

00:15:09.360 --> 00:15:16.620
If you use something like, say, Firebase or AWS Lambda or other things, like, you pay as you use it.

00:15:16.620 --> 00:15:18.800
And generally that's to your advantage.

00:15:18.800 --> 00:15:19.080
Right.

00:15:19.080 --> 00:15:20.640
But the you isn't really you.

00:15:20.780 --> 00:15:22.740
The you is your users are using it.

00:15:22.740 --> 00:15:23.000
Right.

00:15:23.000 --> 00:15:25.740
And you don't necessarily know how much your users are going to use it.

00:15:25.740 --> 00:15:25.940
Right.

00:15:25.940 --> 00:15:27.180
I mean, it's a good problem to have.

00:15:27.180 --> 00:15:28.180
Like, I have lots of users.

00:15:28.180 --> 00:15:29.320
They're using my app a lot.

00:15:29.320 --> 00:15:31.740
So I'm using my cloud service a lot.

00:15:31.740 --> 00:15:33.880
But it's super, super scaling.

00:15:33.880 --> 00:15:42.760
And it turns out that if you program badly, you may have a higher bill than you otherwise expected.

00:15:42.760 --> 00:15:43.280
Yeah.

00:15:43.280 --> 00:15:48.700
So here's an example, which I think is just maybe a cautionary tale for everyone using clouds.

00:15:48.700 --> 00:15:52.240
And it doesn't really too much depend on, like, what cloud you're using.

00:15:52.240 --> 00:15:55.860
Anything that where the price depends upon user consumption.

00:15:56.000 --> 00:15:57.960
I have a real world example for myself.

00:15:57.960 --> 00:15:58.860
I'll tell you about it at the end.

00:15:59.280 --> 00:16:06.580
But the article I want to cover here is the title is how we spent $30,000 in Firebase in less than three days.

00:16:06.580 --> 00:16:07.420
Wow.

00:16:08.020 --> 00:16:15.520
And Firebase is like a database as a service exposed over, like, HTTP endpoint for JavaScript type of thing.

00:16:15.520 --> 00:16:18.240
Like, that's pretty much my understanding of it.

00:16:18.240 --> 00:16:18.960
I don't really use it.

00:16:18.960 --> 00:16:27.600
But it's like if I'm doing, say, an AngularJS or some kind of front-end JavaScript app, I can, like, just connect to Firebase straight from my client-side code.

00:16:27.600 --> 00:16:29.480
And then we're good.

00:16:29.480 --> 00:16:31.700
It can do the various things that it needs to do.

00:16:31.700 --> 00:16:31.900
Right.

00:16:31.900 --> 00:16:37.600
So there's this place called Vaki, something like that, in Columbia.

00:16:37.820 --> 00:16:40.100
And it's, like, kind of like Kickstarter, but Colombian.

00:16:40.100 --> 00:16:42.740
And they had just launched.

00:16:42.740 --> 00:16:53.540
And it turned out that they had this project on there that became the largest crowdfunding campaign in Columbia by, like, collecting three times as much money as anyone ever had in the first two days.

00:16:53.540 --> 00:16:56.080
So they collected tons and tons of money.

00:16:56.080 --> 00:17:02.540
They had, like, 2 million sessions, like, 20 million page views, 15,000, like, backings or whatever you call that.

00:17:02.540 --> 00:17:03.300
Sounds good, right?

00:17:03.300 --> 00:17:06.000
Well, it turns out the site was running really slow.

00:17:06.160 --> 00:17:09.060
And the folks who built it, they were somewhat new developers.

00:17:09.060 --> 00:17:10.780
They were like, I don't know what to do to make this work.

00:17:10.780 --> 00:17:11.700
I know what.

00:17:11.700 --> 00:17:13.080
Let's just upgrade all the frameworks.

00:17:13.080 --> 00:17:14.020
We're using Angular 4.

00:17:14.020 --> 00:17:16.240
Let's upgrade to Angular 6 or something to this.

00:17:16.240 --> 00:17:17.040
It wasn't Angular.

00:17:17.040 --> 00:17:17.520
Maybe it's React.

00:17:17.520 --> 00:17:17.840
I don't know.

00:17:17.840 --> 00:17:20.360
Whatever framework they have, they're just like, we're going to upgrade these things.

00:17:20.360 --> 00:17:20.960
Nope.

00:17:20.960 --> 00:17:21.720
That didn't fix it.

00:17:21.720 --> 00:17:21.920
Right?

00:17:21.980 --> 00:17:23.900
So they spent, like, a day, like, poking around.

00:17:23.900 --> 00:17:25.700
And it was still running slow.

00:17:25.700 --> 00:17:27.200
And it kept slowing down more and more.

00:17:27.200 --> 00:17:28.460
They couldn't figure out what's going on.

00:17:28.460 --> 00:17:30.240
And they logged into their Firebase account.

00:17:30.240 --> 00:17:32.280
And they saw their bill was, like, $30,000.

00:17:32.280 --> 00:17:36.300
It was costing $600 an hour more every hour.

00:17:36.300 --> 00:17:36.880
Oh, wow.

00:17:36.880 --> 00:17:37.460
Yikes.

00:17:37.600 --> 00:17:38.740
And they're like, what is going on?

00:17:38.740 --> 00:17:42.180
So it was like, you know, like, Firebase, you pay on, like, the number of calls and type

00:17:42.180 --> 00:17:42.340
of thing.

00:17:42.340 --> 00:17:46.080
So it turned out that they have this little part of the site, just like in Kickstarter, in

00:17:46.080 --> 00:17:48.300
the right, it says there's this many contributions.

00:17:48.300 --> 00:17:51.700
And currently, this much money has been, like, pledged towards this account.

00:17:51.700 --> 00:17:57.520
And I think what happened was their implementation of showing that number, it didn't, like, summit

00:17:57.520 --> 00:17:58.080
in the database.

00:17:58.080 --> 00:18:01.340
It, like, sucked down all the payments table.

00:18:01.340 --> 00:18:04.360
And then, like, added it in JavaScript.

00:18:04.360 --> 00:18:07.500
And it kept doing that to, like, keep it live or something.

00:18:07.500 --> 00:18:09.120
Yeah, every time somebody goes and looks.

00:18:09.120 --> 00:18:09.860
Ah, yeah.

00:18:09.860 --> 00:18:10.640
Yeah, exactly.

00:18:10.640 --> 00:18:14.840
They made, like, 40 billion requests, billion with a B, to their, like, database.

00:18:14.840 --> 00:18:17.840
And that got them, like, a $30,000 bill.

00:18:17.840 --> 00:18:19.860
Yikes.

00:18:19.860 --> 00:18:22.560
So it's pretty interesting.

00:18:22.560 --> 00:18:24.260
Worth checking out, this article.

00:18:24.260 --> 00:18:25.700
The comments are super interesting.

00:18:25.700 --> 00:18:27.020
Some of them are super supportive.

00:18:27.020 --> 00:18:28.420
And others are kind of mean.

00:18:28.420 --> 00:18:30.660
You probably wouldn't imagine this.

00:18:30.660 --> 00:18:32.040
But there's a theme of testing.

00:18:32.040 --> 00:18:34.480
They should have tested better before they rolled out the site.

00:18:34.480 --> 00:18:35.460
Well, yeah.

00:18:35.740 --> 00:18:37.660
But you can't test everything and foresee.

00:18:37.660 --> 00:18:39.260
Yeah, you can't foresee everything.

00:18:39.260 --> 00:18:39.720
That's true.

00:18:39.720 --> 00:18:40.180
Right.

00:18:40.180 --> 00:18:44.040
And I'm sure it seemed fine when you tested it with, like, the 10 purchases they had in

00:18:44.040 --> 00:18:45.120
their little test project.

00:18:45.120 --> 00:18:47.380
But you put, you know, 15,000.

00:18:47.380 --> 00:18:49.360
All of a sudden, it starts to behave badly.

00:18:49.360 --> 00:18:49.760
Yeah.

00:18:49.760 --> 00:18:55.200
And I heard about somebody doing some things, like, similar, not a success story, really.

00:18:55.200 --> 00:19:01.020
Just somebody saying that they would run kind of some abuse testing against a local database

00:19:01.020 --> 00:19:02.660
or local mock service.

00:19:02.660 --> 00:19:04.660
And then set it all up.

00:19:04.660 --> 00:19:09.460
And they were going to just see how it did for abuse testing over the weekend.

00:19:09.460 --> 00:19:14.220
Got back and realized that they were not testing abuse testing in the lab.

00:19:14.320 --> 00:19:16.140
They were abuse testing the live service.

00:19:16.140 --> 00:19:18.460
And, yeah, similar issue.

00:19:18.460 --> 00:19:23.200
A big, huge AWS bill because of the test running all the time.

00:19:23.200 --> 00:19:24.520
So auto skill is amazing.

00:19:24.520 --> 00:19:26.620
It just takes care of all the traffic you have.

00:19:26.620 --> 00:19:28.100
Yeah.

00:19:28.580 --> 00:19:28.940
Wait.

00:19:28.940 --> 00:19:29.800
What?

00:19:29.800 --> 00:19:30.840
How much does this cost?

00:19:30.840 --> 00:19:34.200
So I was thinking about this article, like, a few weeks ago.

00:19:34.200 --> 00:19:35.900
I'm thinking we might cover it on this episode.

00:19:35.900 --> 00:19:38.160
And I'm thought, ah, good thing this doesn't happen to me.

00:19:38.160 --> 00:19:39.140
Never do this.

00:19:39.140 --> 00:19:40.400
Today.

00:19:40.400 --> 00:19:41.680
Today.

00:19:41.680 --> 00:19:43.040
Today.

00:19:43.040 --> 00:19:47.400
Remember, I don't know if I told the audience this, but I know I told you this when we were

00:19:47.400 --> 00:19:48.440
hanging out at PyCon last year.

00:19:48.440 --> 00:19:53.040
Like, for my courses, I set up a whole bunch of different video servers throughout the world.

00:19:53.040 --> 00:19:57.500
So I've got, like, one in Mumbai, one in Tokyo, one in Sydney, one in Frankfurt, and so on.

00:19:57.500 --> 00:19:57.740
Wow.

00:19:57.740 --> 00:20:00.020
And I got tired of synchronizing the files.

00:20:00.020 --> 00:20:00.260
Yeah.

00:20:00.260 --> 00:20:04.660
So I wrote this system that would automatically sync them across the world to these different

00:20:04.660 --> 00:20:05.140
locations.

00:20:05.140 --> 00:20:10.500
Well, it turned out there's a small find and replace that has to be done to adjust the

00:20:10.500 --> 00:20:12.660
location from the source to the destination servers.

00:20:13.040 --> 00:20:17.760
And I logged into that thing today, and it was still synchronizing just continuously.

00:20:17.760 --> 00:20:18.980
I'm like, oh, no.

00:20:18.980 --> 00:20:25.580
This server has been continuously downloading and uploading to S3 as fast as it can for two

00:20:25.580 --> 00:20:25.880
weeks.

00:20:25.880 --> 00:20:26.680
Oh, no.

00:20:26.680 --> 00:20:29.300
I'm like, what is my AWS bill?

00:20:29.300 --> 00:20:31.480
And I logged in, and it wasn't so bad.

00:20:31.480 --> 00:20:34.840
It was, like, $300 more than normal, which is okay.

00:20:35.060 --> 00:20:39.900
But I'm just like, yeah, that pretty much is exactly just a less bad version of what

00:20:39.900 --> 00:20:40.700
happened to these guys.

00:20:40.700 --> 00:20:43.600
And it was because of bad, it was a bad file replacement.

00:20:43.600 --> 00:20:47.220
Basically, sync, the word sync was being replaced in some circumstances.

00:20:47.220 --> 00:20:49.700
And I have a new course called Async.

00:20:49.700 --> 00:20:51.600
And it was taking out the sync part.

00:20:51.600 --> 00:20:53.820
And so it just, it kept going, oh, the file's not there.

00:20:53.820 --> 00:20:54.480
We've got to upload it.

00:20:54.480 --> 00:20:55.120
File's not there.

00:20:55.120 --> 00:20:55.680
We've got to upload it.

00:20:55.680 --> 00:20:57.600
You know, because they just, they mismatched.

00:20:57.600 --> 00:20:59.480
Yeah, that was bad news.

00:20:59.480 --> 00:21:00.620
Oh, yeah.

00:21:01.180 --> 00:21:03.800
Anyway, so it can happen to anyone.

00:21:03.800 --> 00:21:05.440
It happened to me this morning.

00:21:05.440 --> 00:21:07.260
I fixed it, by the way.

00:21:07.260 --> 00:21:08.580
Well, yeah.

00:21:08.580 --> 00:21:12.080
If you're paying for any of those services, check once in a while to make sure that.

00:21:12.080 --> 00:21:12.460
Yeah.

00:21:12.460 --> 00:21:13.300
And you know what?

00:21:13.300 --> 00:21:17.240
I actually, I have, that's kind of one of the takeaways, both from the article and from

00:21:17.240 --> 00:21:20.380
why I wanted to say that, is I have an alarm set at AWS.

00:21:20.380 --> 00:21:23.280
And it says, if my bill goes over this amount, send me an email.

00:21:23.280 --> 00:21:25.100
If my bill goes over this amount, send me an email.

00:21:25.100 --> 00:21:28.200
And I woke up and I saw that alarm as well.

00:21:28.200 --> 00:21:29.840
I'm like, oh, that's not good.

00:21:29.840 --> 00:21:30.820
Yeah.

00:21:31.000 --> 00:21:32.260
So anyway, it's all fine.

00:21:32.260 --> 00:21:33.320
But check it out.

00:21:33.320 --> 00:21:37.640
It's definitely worth thinking about if you do anything that is in the cloud that is based

00:21:37.640 --> 00:21:39.520
on consumption by users.

00:21:39.520 --> 00:21:40.460
Yeah, definitely.

00:21:40.460 --> 00:21:41.000
All right.

00:21:41.000 --> 00:21:42.500
Well, that's our main items.

00:21:42.500 --> 00:21:43.960
I have a really exciting one.

00:21:43.960 --> 00:21:49.060
I wanted to get in, but actually, I just learned about it 15 minutes before we started recording.

00:21:49.060 --> 00:21:51.020
So I didn't have time to dig into it.

00:21:51.020 --> 00:21:56.080
So news is, Dropbox, Dropbox is one of the biggest users of Python, as we know.

00:21:56.080 --> 00:22:00.980
And they have been stuck on Python 2 for what seems like eternity, which is so ironic because

00:22:00.980 --> 00:22:02.160
Gita Van Rossum works there.

00:22:02.160 --> 00:22:06.360
And some of the other core developers that work there is like, yeah, Python 2 all day.

00:22:06.600 --> 00:22:07.780
You know, got to love it.

00:22:07.780 --> 00:22:08.000
Right.

00:22:08.000 --> 00:22:12.500
So the big news is, as of yesterday, Dropbox is now upgraded to Python 3.

00:22:12.500 --> 00:22:15.100
And they have like a nice article right up on it.

00:22:15.100 --> 00:22:16.400
We'll cover it in more depth next week.

00:22:16.400 --> 00:22:19.080
But I'm going to link to it now since it's timely and important.

00:22:19.080 --> 00:22:20.120
That's so cool, though.

00:22:20.120 --> 00:22:20.560
Yeah.

00:22:20.560 --> 00:22:21.220
Very neat.

00:22:21.220 --> 00:22:21.440
Yeah.

00:22:21.520 --> 00:22:22.860
What about conferences?

00:22:22.860 --> 00:22:24.760
Well, we just got an announcement.

00:22:24.760 --> 00:22:30.620
I think I just saw this today that the call for proposals for the 2019 PyCon is now open.

00:22:30.620 --> 00:22:31.260
Oh, really?

00:22:31.260 --> 00:22:31.680
Yeah.

00:22:31.680 --> 00:22:32.620
That's pretty awesome.

00:22:32.620 --> 00:22:36.900
So you can get started on your proposals for next year.

00:22:36.900 --> 00:22:37.300
Yeah.

00:22:37.300 --> 00:22:38.660
I'm thinking about those for sure.

00:22:38.660 --> 00:22:40.620
I definitely have some stuff I want to propose.

00:22:40.620 --> 00:22:41.600
So thanks.

00:22:41.600 --> 00:22:41.900
Yeah.

00:22:41.900 --> 00:22:43.500
See, I learned about stuff right here on the show.

00:22:43.500 --> 00:22:44.540
All I got to do is just sit here.

00:22:44.540 --> 00:22:44.720
Yeah.

00:22:44.720 --> 00:22:46.840
And the PyCascades is still open, too.

00:22:46.840 --> 00:22:47.720
Yeah.

00:22:47.720 --> 00:22:48.280
Until October.

00:22:48.280 --> 00:22:48.680
Yeah.

00:22:49.000 --> 00:22:50.900
So it's proposal time, I guess.

00:22:50.900 --> 00:22:52.340
It's definitely proposal time.

00:22:52.340 --> 00:22:54.100
Also, PyTennessee.

00:22:54.100 --> 00:22:57.120
I can't go, but I know that they have their call for proposals open as well.

00:22:57.120 --> 00:22:58.400
So there's lots of conferences.

00:22:58.400 --> 00:23:01.740
You know, conferences are a spring-summer type thing a lot of times.

00:23:01.740 --> 00:23:04.340
And so the call for proposals are, you know, sort of now.

00:23:04.340 --> 00:23:04.680
Yeah.

00:23:04.680 --> 00:23:09.700
I mean, you know, why not spend your holiday season coming up with things to...

00:23:09.700 --> 00:23:09.960
Yeah.

00:23:09.960 --> 00:23:12.060
That's what I'm doing on Thanksgiving for sure.

00:23:12.060 --> 00:23:13.060
Maybe Halloween as well.

00:23:13.060 --> 00:23:13.840
My kids will love it.

00:23:13.840 --> 00:23:14.740
You know what's scary?

00:23:14.740 --> 00:23:15.760
This talk's going to be scary.

00:23:15.760 --> 00:23:17.340
No, Dad, I want to get candy.

00:23:17.980 --> 00:23:19.360
This is even better than candy.

00:23:19.360 --> 00:23:22.440
No, if you wait until Halloween, you'll miss the PyCascades.

00:23:22.440 --> 00:23:23.300
You got to do that before.

00:23:23.300 --> 00:23:23.800
That's true.

00:23:23.800 --> 00:23:24.380
Yeah, that's true.

00:23:24.380 --> 00:23:25.000
I can't do that.

00:23:25.000 --> 00:23:25.280
All right.

00:23:25.280 --> 00:23:25.560
Anyway.

00:23:25.560 --> 00:23:26.860
No, I won't wait.

00:23:26.860 --> 00:23:27.580
You got one more?

00:23:27.580 --> 00:23:28.020
Worse?

00:23:28.020 --> 00:23:28.600
I got one more.

00:23:28.940 --> 00:23:35.120
So I just released, like, literally an hour and 15 minutes ago or so, released a new course

00:23:35.120 --> 00:23:37.420
called Async Techniques and Examples in Python.

00:23:37.420 --> 00:23:40.380
And this one is something I'm super excited about.

00:23:40.380 --> 00:23:44.960
I've been wanting this course to exist ever since I started in Python.

00:23:44.960 --> 00:23:48.020
And I've decided that I'm going to put in the time to create it.

00:23:48.020 --> 00:23:52.140
And so I just launched a five-hour course on all the async things in Python.

00:23:52.340 --> 00:23:53.700
Oh, that's very exciting.

00:23:53.700 --> 00:23:56.160
Because I want to learn all the async things in Python.

00:23:56.160 --> 00:23:57.320
So I'll have to check that out.

00:23:57.320 --> 00:23:58.600
Well, I have a resource to recommend.

00:23:58.600 --> 00:23:58.840
Yeah.

00:23:58.840 --> 00:23:59.920
So I put the link in the show notes.

00:23:59.920 --> 00:24:02.400
People can check it out at training.talkpython.fm.

00:24:02.400 --> 00:24:04.180
Should be in the course list.

00:24:04.180 --> 00:24:04.540
Nice.

00:24:04.540 --> 00:24:05.200
Cool.

00:24:05.340 --> 00:24:05.840
Yep, definitely.

00:24:05.840 --> 00:24:06.960
All right, Brian.

00:24:06.960 --> 00:24:09.340
Thanks for being here and sharing this with everyone.

00:24:09.340 --> 00:24:10.020
Yeah, thank you.

00:24:10.020 --> 00:24:10.360
You bet.

00:24:10.360 --> 00:24:10.580
Bye.

00:24:10.580 --> 00:24:10.760
Bye.

00:24:10.760 --> 00:24:13.660
Thank you for listening to Python Bytes.

00:24:13.660 --> 00:24:16.220
Follow the show on Twitter via at Python Bytes.

00:24:16.220 --> 00:24:19.120
That's Python Bytes as in B-Y-T-E-S.

00:24:19.120 --> 00:24:22.560
And get the full show notes at pythonbytes.fm.

00:24:22.560 --> 00:24:26.880
If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

00:24:26.880 --> 00:24:29.620
We're always on the lookout for sharing something cool.

00:24:29.620 --> 00:24:32.980
On behalf of myself and Brian Okken, this is Michael Kennedy.

00:24:33.460 --> 00:24:36.600
Thank you for listening and sharing this podcast with your friends and colleagues.

