Latest / Talk Python To Me / #10: Bringing Python to the Masses with Hosting and DevOps at PythonAnywhere
Transcript
- 0:00It's time to obey the testing goat and fire up some Python in the browser.
- 0:04This is Talk Python To Me, episode number 10, with guest Harry J.W. Percival, recorded
- 0:10Tuesday, May 12, 2015.
- 0:12Hello, and welcome to Talk Python To Me.
- 0:42A weekly podcast on Python.
- 0:44The language, the libraries, the ecosystem, and the personalities.
- 0:47This is your host, Michael Kennedy.
- 0:49Follow me on Twitter, where I'm @mkennedy, and keep up with the show and listen to past
- 0:54episodes at talkpythontimmy.com.
- 0:56This episode, we'll be talking to Harry Percival from Python Anywhere about hosting Python applications
- 1:02and making Python available to the masses, as well as his book and mission, TDD in Python.
- 1:09I'm thrilled to tell you that this episode is brought to you by Codeship.
- 1:13Codeship is a platform for continuous integration and continuous delivery as a service.
- 1:18I'll talk more about them later in the show.
- 1:20Please take a moment to check them out at codeship.com or follow them on Twitter, where they're at Codeship.
- 1:25This show is kind of special because I've traveled all the way from the west coast of the United
- 1:30States to cheerio, London to meet with Harry in person.
- 1:33Well, maybe I also came here for a conference in central London, which happens to be close to Python Anywhere's headquarters.
- 1:39Either way, it was really fun to do an in-person interview with Harry.
- 1:43Now, let's get to the show.
- 1:45Harry, welcome to the show.
- 1:48Hi, Michael.
- 1:49Thanks for having me.
- 1:50I'm excited about it.
- 1:50This is really an amazing show.
- 1:53It's the first one we're doing in person.
- 1:55Right.
- 1:56Okay.
- 1:56All right.
- 1:57Well, I hope I don't mess it up.
- 1:58No, you definitely won't.
- 1:59So I'm here in London.
- 2:01I'm not normally in London.
- 2:02I love this place, but I don't live here.
- 2:03So it's kind of unique.
- 2:05And I happen to be at a conference like a block away from your office where Python Anywhere is.
- 2:11Right.
- 2:11There you go.
- 2:12And so why don't we get together and do this in person?
- 2:14And here we are.
- 2:15Fantastic.
- 2:16All right.
- 2:17So I really want to talk about Python Anywhere.
- 2:20I want to talk about Obey the Testing Goat, all those types of things.
- 2:23But let's just start at the beginning.
- 2:25How did you get started in programming?
- 2:27How did you get started in Python?
- 2:28Sure.
- 2:28I guess I started in programming when I was quite young, like a lot of people, maybe when
- 2:32I was 10 years old, on various old bits of hardware from the, this is the sort of early
- 2:3990s, maybe even the late 80s.
- 2:41And I had like an Amstrad PCW green and black background, had like one of the early Olivetti
- 2:49laptops.
- 2:50And this thing had, it had not one, but two three and a half inch floppy drives.
- 2:55Oh my gosh.
- 2:56No hard disk at all.
- 2:57And you could run, you could run MS-DOS on one and Microsoft Word or a really good copy
- 3:02of Snake on another one.
- 3:04And then at school we had them as well.
- 3:07So I was programming in basic.
- 3:08I had a few books from America.
- 3:11And at school we had these things called Thompson TO7s.
- 3:14I've never heard of that thing.
- 3:15Yeah.
- 3:15Okay.
- 3:16So it's a, it's like a, it's a big ugly box thing that you plug into a television screen
- 3:20and it's got these like rubber keys on and they go like boop when you press them.
- 3:25You know, 10 going toot, doot, go to 20.
- 3:28And we're programming basic.
- 3:31And the cool thing with that actually was that they had, they had this thing called an input
- 3:35pen, which was like this pen thing that you could press against the screen.
- 3:38And it had some voodoo that then would be able to register an XY coordinate against where
- 3:42it was on the TV screen.
- 3:43I guess it was like calculating where the sort of raster had got to or something like that.
- 3:48That's pretty cutting edge for it.
- 3:49What year was this?
- 3:50This is like 1992, I'm going to say.
- 3:53Wow.
- 3:53Right.
- 3:53That predates Mozilla.
- 3:55Well, I think those computers were already old then, to be fair.
- 3:57And so, yeah, we would make like little drawing programs on them, which is really cool actually,
- 4:03because if you watch kids programming these days on much more advanced computers,
- 4:06they've got really cool things like Scratch.
- 4:07They don't have to go through basic and go-tos.
- 4:09But they did exactly.
- 4:11I mean, you watch kids in schools doing this.
- 4:12They do exactly what I did at that age, which as soon as you figure you can do some graphics
- 4:16on the screen, you start making a paint program, you draw circles and squares and spirals and
- 4:20things like this.
- 4:21And so, yeah, yeah, that sort of thing.
- 4:23I'm sure everyone's got a similar story.
- 4:25That's awesome.
- 4:26So that's basic.
- 4:28How about Python?
- 4:29Yeah.
- 4:30So that was my origins, right?
- 4:32I was on the right path.
- 4:33And then somehow my life went wrong and I sort of went and studied economics and I got a job as a management consultant,
- 4:40which was very tedious.
- 4:43And I didn't really do any programming other than kind of overcomplicated Excel spreadsheets
- 4:48until I was pretty much 30 years old.
- 4:51And this is like 2008.
- 4:54I took a sabbatical from my job, which turned out to be just me quitting, basically.
- 4:58Go off and do a new degree and get a master's in computer science and just learn programming again
- 5:04and kind of do it properly.
- 5:05And then I went off and that's what I do now.
- 5:08Nice.
- 5:09Was it really refreshing to step away from science?
- 5:12Yeah.
- 5:12Well, management consulting is a lot of talk, not so much action.
- 5:18Yeah.
- 5:18Yeah.
- 5:19I mean, so it's not for everyone, I think.
- 5:21It wasn't for me.
- 5:22And it was interesting in parts.
- 5:25But I found myself, like, just if I looked at the part of the job that I enjoyed,
- 5:28it was mostly just making an overcomplicated Excel spreadsheet and, you know,
- 5:32like just a 25-line functions in Excel and, like, VBA to do things that were, like,
- 5:37absolutely not required by the project that I thought were cool.
- 5:40So, you know, there was a clear direction I should probably have been going.
- 5:44You should have taken that clue.
- 5:45You know, my programming experience is like that as well.
- 5:50I kind of became an accidental programmer.
- 5:52I was working on my PhD in math and was working on some Silicon Graphics,
- 5:56like supercomputers, right?
- 5:57And I remember after about a year of working on this project,
- 6:01it was this cool 3D simulator that I really enjoyed working on,
- 6:04except when I got to the math parts.
- 6:06And then after about six months of that, I'm like, you know,
- 6:10maybe I should take this as a clue that I should stop doing math and go do computers.
- 6:14So very cool.
- 6:14Nice to hear that.
- 6:15Yeah.
- 6:16So I know you because when I was looking for a place to host my website and get started,
- 6:21I ran across Python Anywhere and I thought, wow, this is a super cool project you guys have.
- 6:27It is amazing.
- 6:28And so maybe you could tell me about that.
- 6:30It's only moderately amazing.
- 6:33It's pretty awesome.
- 6:35Well, let's see.
- 6:36So Python Anywhere is kind of, what is it?
- 6:40It's a place where you can code Python in your browser.
- 6:45And that could mean a lot of things.
- 6:47And what it means for us eventually is like, I guess where we're really headed is to try and sort of be as Google Docs is to Microsoft Word.
- 6:55Maybe we could try and be that to installing and running Python on your local computer.
- 7:00Right.
- 7:01So if you have Python that runs, you know, in the cloud with apologies for the buzzword, what can you do?
- 7:07Well, so first of all, you don't have to install any software on your PC.
- 7:09So you go along, you can come to our website and we'll give you a text editor, which is going to work.
- 7:15And it's going to have syntax highlighting for Python and even maybe some error checking with the PyFlakes.
- 7:20It's going to have a console just like you would have on your own computer and not just like a sort of line by line console, but like a real terminal emulator there.
- 7:27So you can have tab completion.
- 7:28You can run Vim or Emacs in it.
- 7:30And we'll try and give you those tools that you're used to having on your PC in the cloud.
- 7:34And what that gives you is the ability to kind of run things from anywhere.
- 7:39And it gives you the ability to do more kind of collaboration things that are a bit harder to do on your own computer.
- 7:43And then you can do some number crunching that maybe you can't do on your own computer because we can do maybe a little paralyzation for you.
- 7:51And then finally, we can do web hosting.
- 7:52So, you know, like we're already on servers.
- 7:55It's that much, not much effort for us to then say, okay, well, we'll give your code some sort of public access to the Internet.
- 8:01And so, you know, we end up having a lot of people just hosting websites on that.
- 8:05Yeah, that's really cool.
- 8:06Can you speak to, like, what percentage of users are doing what type of use case?
- 8:11It's hard to tell, really.
- 8:13Like, because we've got an awful lot of users of free users who come along.
- 8:18And then, you know, like any website, there's some of them come and check it out and go, cool, and never come back.
- 8:22And a lot of them will never talk to us.
- 8:24So we're not too sure what they get up to.
- 8:26But of the ones that pay us, an awful lot of them do use it for web hosting.
- 8:34So, you know, we built this thing.
- 8:36What it came out of was actually an online spreadsheet.
- 8:39Okay.
- 8:40So the company I work for is called Python Anywhere Now.
- 8:42But when I joined it, it was called Resolver Systems.
- 8:44And what they were building was a Pythonic spreadsheet.
- 8:49So I mentioned I love spreadsheets earlier.
- 8:51Yeah.
- 8:52The reason I got this job is because I decided to do my thesis as part of my master's on spreadsheets.
- 8:57That's amazing.
- 8:57And what I thought I'd do is I'd phone out around a few companies that do spreadsheet software.
- 9:02And, like, other than Microsoft, right, there's only, like, a very few of these, and they're small.
- 9:06And I would just ask them, hey, I'm going to do a thesis all about spreadsheets because I'm crazy.
- 9:10And probably if you guys love spreadsheets like I do, you want to sponsor me, right?
- 9:14And there was one company stupid enough to say yes to that.
- 9:17And that was Resolver Systems.
- 9:19And that's how I ended up working there.
- 9:20And they were making a Pythonic spreadsheet.
- 9:21So, like, just imagine Excel, which works like Excel, except that when you want to script it, you get to use Python instead of using VBA.
- 9:29That's a nice place to be, I would think.
- 9:31It was really good fun and a great tool.
- 9:33But, like, ultimately, if your pitch is you want to try and tell people to stop using Excel and use this other tool, it's a very high mountain to climb.
- 9:41Yeah.
- 9:41Even Google.
- 9:42I think they're having some success with Google Docs.
- 9:44But even for them and their reach, that's a hard story to tell.
- 9:47Yeah.
- 9:47So, like, for a small, like, five-person company out of London, it had a dedicated following of people who loved it because it was loads of fun.
- 9:55But so that wasn't necessarily working.
- 9:58So the first pivot was, like, let's take that online, right?
- 10:01And let's build that tool.
- 10:02Instead of having a desktop app, let's make it web-based and see whether people like that.
- 10:07And they did.
- 10:07And they liked the sort of number-crunching aspect.
- 10:09But this was a sort of very, like, lean startup-y thing we were doing.
- 10:13Let's reinvent this product online.
- 10:15We did that sort of for three or four months.
- 10:16I tried to gather a lot of user feedback.
- 10:18And what people were coming back to us and saying is, you know, like, the coolest thing about this isn't the spreadsheet part.
- 10:23It's just the fact that I can actually run Python scripts online off my computer in the cloud.
- 10:28And I can just go there and it's there.
- 10:29And so we said, all right, fine.
- 10:31What if we dropped the spreadsheet bit and just had Python in the cloud?
- 10:34What would that look like?
- 10:35And that was Python.
- 10:36Anyway, that's really interesting.
- 10:37There's some parallels to Docker and .cloud, I think.
- 10:40Totally.
- 10:40In there, right?
- 10:41Like, the thing that was just the foundation of your actual product became the product.
- 10:45Yeah.
- 10:45And the thing that worked so well.
- 10:46Yeah.
- 10:47The classic Silicon Valley pivot, although in this case, Silicon Roundabout pivot.
- 10:51Yes, the Silicon Roundabout, which is, what, a few blocks away in London, that district.
- 10:55Excellent.
- 10:56Thanks for having me.
- 10:56Thanks for having me.
- 10:56Now, let me take a minute and tell you about our sponsor for the show, CodeShip.
- 11:09CodeShip is a hosted continuous delivery service focused on speed, security, and customizability.
- 11:16You can set up continuous integration in a matter of seconds and automatically deploy when your tests have passed.
- 11:22CodeShip supports your GitHub and Bitbucket project.
- 11:25You can get started with CodeShip's free plan today.
- 11:29Should you decide to go with a premium plan, Talk Python listeners can save 20% off any plan for the next three months by using the code TALKPYTHON.
- 11:39That's T-A-L-K-P-Y-T-H-O-N, all caps, no spaces.
- 11:44Thanks to CodeShip for sponsoring the show, and I encourage you to check them out right now at CodeShip.com and thank them on Twitter where they're at CodeShip.
- 11:53CodeShip.com and thank them for joining us.
- 12:24Is it on multiple data centers or is it on one?
- 12:27No, at the moment it's just in one.
- 12:28And as we grow, we get a few customers going, hey, can we get some in Australia or can we get some on the West Coast or whatever.
- 12:34But U.S. East one, A, B, C, D.
- 12:37Somewhere in northern Virginia.
- 12:39That's it, yeah.
- 12:40I have cousins down there, a lovely countryside.
- 12:42Fantastic.
- 12:43Yeah, so I think that's a really interesting place to be in.
- 12:47Like I said, the way I found about you guys is I'm actually hosting my website for the podcast on there.
- 12:53Right.
- 12:54And that thing is super responsive.
- 12:55I really like the experience.
- 12:57So I tried to find these other places that would host it, and they're like, oh, yeah, we'll support Python 2 and Python 3, but, oh, we don't support Pyramid, which is one of the framework I use for the website.
- 13:09Or, yeah, we support Pyramid, but we only do Python 2, and I write it in Python 3, and I'm like, you know, because it's a brand new project.
- 13:15Like, I can write this in, like, Python 3.
- 13:17That'll be fun.
- 13:17Until I wanted to host it.
- 13:19Then it was not so much fun.
- 13:20And I just stumbled across you guys, and I think what you're doing is really, really cool.
- 13:23You know, you support a whole bunch of different interpreters, yeah?
- 13:28Well, Python interpreters, yeah.
- 13:30Of course, yeah, of course.
- 13:31So you've got several versions of Python 2, several versions of Python 3.
- 13:35Yeah.
- 13:35PyPy, which I thought was just because you can, right?
- 13:39Why not?
- 13:40That is really cool.
- 13:42Did you have to do anything special to support that?
- 13:44No, no, it's okay.
- 13:45So, I mean, supporting things from the web hosting point of view means we use UWSGI or MicroWISGI,
- 13:53if some people have it in the background, and that just has plug-ins for various interpreters,
- 13:57including non-Python ones.
- 13:58So it's just a matter of activating the ones that we think we can do.
- 14:01So, like, we could actually, if we wanted to, go off and make RubyAnywhere.com.
- 14:06The trouble is, none of us know anything about Ruby.
- 14:08So we could do it.
- 14:09Technically, it wouldn't be hard.
- 14:11But then I think we're taking on a lot of users that would be asking us questions that we don't know how to answer.
- 14:14Right, sure.
- 14:15And there's places that host Ruby, but you guys are hosting Python really well.
- 14:18Yeah.
- 14:18And that's the sweet spot.
- 14:19I mean, there's lots of people out there in there.
- 14:21You know, so if you're someone going, oh, okay, I want to run my code on some servers,
- 14:25like whether that's for web hosting or anything else.
- 14:28But, you know, you can go to Amazon straight.
- 14:30You can run your own server in a cupboard.
- 14:32You can go to Google App Engine or Compute, as it's now called.
- 14:38Or you can go to Heroku or you could go to .cloud in the old days.
- 14:42And so it's about sort of figuring out where there's a space in that sort of fairly crowded market.
- 14:48And I think the one is, like, let's focus on Python because that's what we know.
- 14:50And there's plenty of business there.
- 14:52And then let's try and say, okay, well, the hard work if you're running your own server is all the kind of sysadmin and configuration and maintenance.
- 15:00There's this kind of tradeoff between, like, the ultimate flexibility is if you do everything yourself.
- 15:04Right.
- 15:04Go to Z2, start up in Linux machine.
- 15:07Yeah, yeah, yeah.
- 15:08But then it's your Linux machine you've got to babysit.
- 15:10Yeah.
- 15:10So it's more effort.
- 15:11So, like, more flexibility, more effort.
- 15:13And then there's, like, the other end back in the old days, like Google App Engine, where they would do a lot of the work for you, but they were also very restrictive.
- 15:19So we'd say, right, well, you can use App Engine, but, you know, these are the rules about what kind of things you can run.
- 15:23It's this version of Python.
- 15:24You know, these things won't work.
- 15:26And you have to, you know, like, all your requests will be killed after X seconds.
- 15:29Don't touch the files.
- 15:30Yeah, no database, no nothing.
- 15:32And so we, like, so we're sort of somewhere between those two, trying to give, like, there's enough flexibility that people find it interesting.
- 15:38Whilst solving enough of the problems that developers don't want to have to think about.
- 15:42You know, scaling, backups, load balancing.
- 15:45Yeah, so maybe we could talk about the sort of experience of creating a website in there.
- 15:49And then we should also talk about other things like web job type stuff, which I think is interesting.
- 15:55But you go there, you say, I want to create a website.
- 15:56You can do that for free, right?
- 15:58Right.
- 15:58So I can create a free website as long as I don't care about the domain name.
- 16:01Yep.
- 16:01It would be .pythonanywhere.com.
- 16:03Yeah, exactly.
- 16:04Something .pythonanywhere.com.
- 16:05Your username .pythonanywhere.com.
- 16:08That's right.
- 16:09And then I'm giving something that's really interesting.
- 16:12It says, here is your bash shell in a browser.
- 16:16Yeah.
- 16:16To configure your environment.
- 16:18Yeah.
- 16:18Yeah.
- 16:19And basically I can start with, like, a virtual environment.
- 16:23Yeah.
- 16:23Yeah.
- 16:24Exactly.
- 16:24I mean, so we haven't done enough about this, but we want to try and so, you know, people who learn Python, there's a sort of first learning curve, like, trying to get it installed and figuring out how pip works and can you install packages.
- 16:38And we try and solve that problem for people by just saying, look, Python is already installed.
- 16:43Here it is.
- 16:43You just type Python or you click this button that says which version of Python you want.
- 16:47And then, you know, like, how do you install packages?
- 16:49Well, here's pip.
- 16:50It will just work.
- 16:51And also we've pre-installed a bunch of them just of popular things.
- 16:54So maybe it's already there.
- 16:55Nice.
- 16:55Like, what are the popular ones you have installed?
- 16:57We have, like, a file that we have overdone it.
- 16:59There's, like, a thousand packages installed.
- 17:01Like, SciPy, NumPy, Pill, blah, blah, blah, blah, requests.
- 17:05And so many of them.
- 17:07Yeah.
- 17:08But in the web apps thing, it's the same thing.
- 17:11And they go, okay, well, great.
- 17:12I've developed a little, you know, I want to develop a web application.
- 17:15What do I do?
- 17:15Well, you know, now you're going to need to install this web framework.
- 17:18You need to configure the following settings files.
- 17:21You need to have a folder structure that looks like this.
- 17:22You need to put your static files over there.
- 17:24And if you're on a web server, then you'll want to configure, you know, a static file serving here and a database there and an environment variable there.
- 17:30And we just want to try and do as much as possible to try and just kind of give users a thing that works.
- 17:36They can get started with it.
- 17:37And so we've tried to do a bit of that.
- 17:39And so we've tried to do a bit of that.
- 17:41So if you want to start, like, a Django project, you can go to our web tab, go start a new project.
- 17:47Do you want to use Django?
- 17:47Yes.
- 17:48And we'll install Django for you and set up a basic sort of run the sort of Python manage.py start project for you.
- 17:54And there'll be a working Django site there.
- 17:57And you can start with that.
- 17:58Yeah.
- 17:58That's the idea.
- 17:59And, like, you know, we need to do more work.
- 18:00The version of Django we have for Python 2 if I'm nitpicking is out of date.
- 18:03So then, okay, you do have to use a virtual environment.
- 18:05And that's a bit more complicated and blah, blah, blah.
- 18:07I think the fact you have the virtual environment possibility there means that you can do whatever you want more or less on the system.
- 18:15But you don't have to manage the infrastructure.
- 18:18And so in my mind, I think you guys are a very interesting blend of platform as a service and infrastructure as a service.
- 18:24So, like, I see it as infrastructure because I get a bash shell.
- 18:28I can really kind of install stuff.
- 18:30I can work with the file system.
- 18:31It's kind of like a VM.
- 18:32But it's platform as a service because I don't care what the web server version is.
- 18:36I don't care about Linux and I'm setting that up.
- 18:39Yeah.
- 18:40You take care of it for us, right?
- 18:42Yeah.
- 18:43I guess.
- 18:43So that's right.
- 18:44Some other people will try and hide some of that stuff from you and just give you a thing where you write some config files and then...
- 18:50Like Google Compute, for example, right?
- 18:53Yeah.
- 18:53And then, like, magic happens.
- 18:55And ours is a little bit...
- 18:56Maybe it's more about trying to recreate the kind of environment you have on your own laptop when you're running a dev version of a Flask app or something.
- 19:04You know how that works.
- 19:06Making that as much as possible the same on Python Anywhere where you just go, okay, well, if I wanted to edit a file in Bash or whatever, I can.
- 19:13And it's just that this part over here will do the web serving of it.
- 19:17Or if I want to view my log files, I can just, you know, tail my log file over here and there it is.
- 19:22So I don't have to go through some complicated UI to go and retrieve the log file, you know, it can do it in Bash.
- 19:27Yeah, that's really cool.
- 19:28I feel like, you know, it's a nice middle ground because...
- 19:32I'm getting more enthused about my own website by talking to you about it.
- 19:35It's all you should.
- 19:35This is great.
- 19:35This is fantastic.
- 19:36I'm here to make you excited.
- 19:38Keep you going because you're doing awesome stuff.
- 19:40So...
- 19:41Thank you.
- 19:41I feel like you're making me maintain things but making me maintain the right things.
- 19:47So I've created a virtual environment and everything in the virtual environment is my problem.
- 19:50But that's cool because I decide when I upgrade Pyramid or Requests or whatever, and that's all in line with what my app's doing.
- 19:57But everything else I don't care about, right?
- 19:59Like, would you upgrade Python 3 for me at some point?
- 20:02Like, would I just magically switch to a new version of Python?
- 20:05Well, you need to rebuild virtualenv if you switch to Python.
- 20:08Right, of course.
- 20:09That's right.
- 20:09But we're trying to be a bit clever about that.
- 20:11And we're trying to think of ways where you can say, you know, virtualenv is actually a bit scary for beginners.
- 20:15Sure.
- 20:16Like, they're used to going, all right, I figured out this command line thing.
- 20:19I know that if I type Python, I'm going to get a Python prompt.
- 20:22Okay, fine.
- 20:23And then you go, right, but, aha, you need a virtualenv.
- 20:26And so that when you do your command prompt, you have to check, have you activated the virtualenv, and is it the right one?
- 20:30And, like, this is another point at which some big N is just going to go, what?
- 20:33I just forget it.
- 20:34Yeah, it's scary.
- 20:35So people get that wrong.
- 20:37And so that's why we try and give a default no virtualenv setup that might work.
- 20:41And then we try to see if there's ways we can maybe build a bit of a GUI around the virtualenv stuff one day,
- 20:47where you say, like, a virtualenv is a thing that Python Anywhere understands.
- 20:50And so it knows what your virtualenvs are.
- 20:51And we can give you a GUI that says, this is what your virtualenvs are.
- 20:54And if you don't want to edit your virtualenv through bash with, you know, pip freeze angle bracket requirements.txt,
- 21:02maybe we can give you a UI for that, and then you can selectively click on things and upgrade them.
- 21:06Yeah, you could surface, like, the top 100 most popular packages, and they could check them off.
- 21:11Yeah, yeah, yeah, yeah, exactly.
- 21:12So things like that.
- 21:14But that's, I mean, that's Vaporware, so I apologize for talking about it.
- 21:17No, but these are good ideas.
- 21:19I think it would really move it down farther.
- 21:21So web hosting, you said, is kind of what people who are paying you, people like me, are doing.
- 21:27But there's other stuff you can do as well, right?
- 21:29Like, one thing I saw is I can run, like, scheduled jobs.
- 21:31So if I want to, you know, like, run a script that, like, sucks down some sort of screen scraping type thing.
- 21:37Absolutely.
- 21:38Beautiful soup.
- 21:38Yeah.
- 21:39I can do that, yeah?
- 21:39A lot of people do that, yeah.
- 21:40So a lot of people are using it for web hosting.
- 21:43A lot of people do scraping.
- 21:44And so we have this thing, scheduled tasks.
- 21:46It's basically cron jobs.
- 21:47Yeah.
- 21:47And you get to say, oh, yeah, every hour, every day, this sort of time, I'd like to run this script, whatever script you want.
- 21:53And we'll go ahead and run that for you.
- 21:54And maybe it's, you know, pulling down some data and saving it to a database, which maybe you've also got a web app that's then displaying that data.
- 22:00I don't know, show me the train times or something.
- 22:02Whatever.
- 22:03Yeah, so people do it to, like, run automated jobs that they don't need to keep their own computer switched on for.
- 22:09And then the third category of user, I guess, who might pay us are people doing big number crunching.
- 22:16So every so often we get some people coming along going, right, I want to just download megabytes and megabytes of tweets and, like, just run massive number crunching sentiment analysis on them.
- 22:27And so we have a system where if you use a certain amount of, like, CPU power on the system, we kind of put a quota on that each day.
- 22:36When you go past that quota, we don't switch your stuff off.
- 22:39We just put it in a tar pit where it gets slowed down.
- 22:41And so if you want to do a lot of number crunching all day long, then you have to pay us to get a higher quota so that it's actually going to run at a reasonable speed.
- 22:49Right.
- 22:49That's the deal there.
- 22:50Your web apps don't have that restriction right now, do they?
- 22:53So they don't count towards your quota?
- 22:56Yeah, yeah.
- 22:56We find most web apps aren't big number crunching sources.
- 22:59And we do actually have a thing where if a web request hasn't responded within, I think, the limit is five minutes, we kill it.
- 23:06That seems reasonable.
- 23:08It seems reasonable to us.
- 23:11So, yeah, you could try and very cleverly circumvent our number crunching restrictions by building a web app if you want, but it would be pretty painful.
- 23:19Yeah, no, I'm just more like thinking it's just not something you have to worry about with web hosting.
- 23:23It's more of a jobs sort of consideration, right?
- 23:26That's right.
- 23:26Yeah, yeah, yeah.
- 23:27Because I was feeling really good.
- 23:28I'm like, after a half a day, I have a lot of hits on my site.
- 23:31So I've used up 0.00 seconds of my time.
- 23:34I'm like, wow, I wrote that thing pretty efficiently.
- 23:36But not really, right?
- 23:37No, that's right.
- 23:38We don't count the web hits.
- 23:39And the web model in general is that, you know, like, so it's like any, what do you call it, shared multi-tenancy?
- 23:47I don't know.
- 23:48Yeah.
- 23:48But the point is that you can, like an airline booking system.
- 23:52Oh, God, I just compared myself to an, I compared our website to an airline booking system.
- 23:56This is the worst PR ever.
- 23:57You know, like, we can host a lot of people on a big web server, and most of them are, like, not going to be doing very much.
- 24:04And every so often, if someone hits the front page of Hacker News, you know, if you run your website on an Amazon micro instance, right, it's pretty fast most of the time.
- 24:14And the way Amazon work is that, you know, they'll do really, really fast hits on requests.
- 24:19And once you've used about 10 seconds of continuous CPU power, they throttle you down to nothing.
- 24:23Yeah.
- 24:24Right.
- 24:24So it's great for running a website that gets low traffic, and it's super cheap, and it can be free.
- 24:29But then if you hit Hacker News, your website just goes down.
- 24:33Yeah.
- 24:33Whereas, long on all.
- 24:34When you need it most, it lets you down.
- 24:35Like, the one you finally have gotten the word out about, and it's toast.
- 24:40Right.
- 24:40So whereas we say, hey, look, like, we're running, so you're on servers that have spare capacity.
- 24:45They're big servers.
- 24:46We use triple extra larges.
- 24:48I forget which one on Amazon.
- 24:50So when someone gets, you know, Hacker News, they just start using up more of the CPU on that instance for however long they're at the front page of Hacker News for.
- 24:58And that's, like, we're fine with that.
- 24:59That's part of the plan.
- 25:00You know, if it turns out you're still at the front page of Hacker News after several days, like, we are going to notice, and we're going to have a quiet word with you about maybe it's time to start paying us.
- 25:09Yes.
- 25:10But in the meantime, it's a nice thing, so you don't have to be scared of that sort of getting slash dotted moment.
- 25:15Yeah.
- 25:15A friend of mine said, when I told him I was using your service, Python, and he said, well, why don't you just go to EC2 and create, like, a micro Linux?
- 25:25I'm like, one of the things I really liked is it's really running on a big machine, and it has a lot of power.
- 25:31It's just kind of shared, but, you know, those spikes kind of even out.
- 25:35And so it seems like it's way more responsive than a micro instance for me.
- 25:40Yeah.
- 25:40Yeah.
- 25:40So that's the idea.
- 25:42It's like we can provide that.
- 25:43Within reason, we can scale up for when you get crazy traffic unexpectedly.
- 25:49And if it turns out to be forever, then we're just going to come after your money.
- 25:52It seems fair.
- 25:54Gently encourage you to upgrade.
- 25:55It seems fair.
- 25:57So other than, of course, talkpythontome.com, are there other notable moments that you guys can talk about?
- 26:05Certainly, talkpythontome.com is our favorite website.
- 26:08I would say so, yeah.
- 26:10If it's not the one that's getting the most hits, it is certainly the best one.
- 26:12Well, yeah.
- 26:16So who do we host?
- 26:18We've got a sort of funny niche in the Web2Py community.
- 26:21So we host Web2Py.com, and we've got lots of users of that site.
- 26:25And then a sort of case study example we sometimes trot out, which is a terrible example.
- 26:34Again, bad PR, but it's just fun.
- 26:35There's this guy.
- 26:38He's a student at university, and he made a website called Stereodose.com.
- 26:43Stereodose.com.
- 26:45Is that D-O-S-E?
- 26:46Yeah.
- 26:46Yeah, and the Stereodose.com website is very simple.
- 26:49What it says is like you come into a screen.
- 26:52It says, pick your mood.
- 26:53And it sort of says like energetic, mellow, a couple of other choices like funky.
- 26:59And then screen number two says, pick your drug.
- 27:02Right?
- 27:03And you get to choose acid, mushrooms, ecstasy, weed.
- 27:06And then it's going to auto-generate a playlist for you that's appropriate to your mood and drug of choice.
- 27:11Fantastic.
- 27:12Right?
- 27:12So he's a university.
- 27:13He's a college, right?
- 27:14This is hugely popular.
- 27:16I've asked all his friends.
- 27:16So he knocked this together in no time.
- 27:18It's a simple website, right?
- 27:19And he hosted it with us.
- 27:21And so he had the equivalent of hack and use.
- 27:24I don't know what the equivalent of hack and use is for drug-induced playlists.
- 27:27But he got on that.
- 27:28And so he went from 10 hits a day to 10,000, 100,000 an hour.
- 27:35And we were just like, yep, fine.
- 27:36Very mellow hits.
- 27:38Yeah, some of them.
- 27:39Some of them were like really hyperactive.
- 27:41Just keep refreshing the thing.
- 27:44That's pretty cool.
- 27:46Yeah, so that's an example.
- 27:48So he made that thing.
- 27:49Out of nowhere, it got popular.
- 27:50And then we were just able to handle that fine.
- 27:52And then gently suggested that now he's making some money off advertising.
- 27:55Could he pay us X dollars a month?
- 27:56I think, yeah.
- 27:58Probably he's still on quite one of the quite low plans, like $20 a month.
- 28:01Yeah, yeah, probably.
- 28:02And so that's very cool.
- 28:04Well, we do that for some of the first customers that have a big hit.
- 28:07We like to reward them by keeping them around at a price that's quite frankly cutting our own throats, Michael.
- 28:12Cutting our own throats.
- 28:13What can you do?
- 28:14It's what you have to do now.
- 28:15It's what you have to do.
- 28:16So we were talking earlier before we started recording.
- 28:20You said you do a lot of Python sort of end-to-end of the whole thing.
- 28:24So looking in from the outside, obviously, it's interesting that I can host Python there.
- 28:29But can you talk a little bit about what the internal usage is and how that goes?
- 28:34Yeah, yeah.
- 28:34So it's all Python inside as well.
- 28:35It was the same.
- 28:36So the guys talk about Resolver Systems and that spreadsheet product.
- 28:39They decided to start building it in Python and they were going to target Windows.
- 28:43So they built it in Iron Python.
- 28:44Okay.
- 28:44And they went, hey, let's build it in Iron Python.
- 28:46And then, like, obviously, it'll get too slow at some point.
- 28:48And then we'll start writing some C or some C#.
- 28:51And they found with that they just never reached that point.
- 28:53Like, they just keep going in Python.
- 28:55It was fine.
- 28:55And so we had a similar approach with Python anyway.
- 28:57And they said, well, Python is what we love.
- 28:59It's the fastest way to get websites built that we're going to be able to do.
- 29:03So let's just start with that and see if we ever need anything else.
- 29:05And no, we don't really.
- 29:07I mean, there's about four lines of lua somewhere.
- 29:11And there's a bunch of JavaScript, obviously, which is a nightmarish help.
- 29:17Yeah.
- 29:18But other than that, yeah, no, it's all Python.
- 29:20I'm just trying to think of any exceptions to that.
- 29:23Python 2?
- 29:24Python 3?
- 29:25Well, yeah, Python 2.
- 29:27Yeah, of course.
- 29:28Well, we're joining a club with literally everybody else.
- 29:30But I think you are doing a good deed to have a wide variety of interpreters, right?
- 29:36Like, even PyPy is super cool.
- 29:38Yeah.
- 29:38Yeah.
- 29:39Yeah.
- 29:39I mean, yeah, so making the choice to sort of start supporting Python 3 for web apps, for example.
- 29:44You know, just having Python 3 around, I mean, you can install it on your own computer in seconds.
- 29:48So that's fine.
- 29:48It's like supporting it for a real thing on the internet, like an application was, you know, we were looking at it going, is this going to be a niche concern?
- 29:56But then we were saying, look, a lot of the people who come to us are beginners or hobbyists or not professional programmers.
- 30:01And the message out there is, yeah, you should use Python 3.
- 30:04And so to support them well, I think we did.
- 30:06We did have to go, okay, well, even if we're not using ourselves right now, the wider world, yeah, our users want this.
- 30:12So, yeah.
- 30:13For sure.
- 30:14That's cool.
- 30:14Yeah.
- 30:14I talked with Kenneth Wright.
- 30:17Yeah, I had that.
- 30:17About Python 2 and Python 3.
- 30:20And, you know, it seems like it's some of the little things that make a big difference.
- 30:25He said that having Django switch their docs by default to Python 3 made, you know, a noticeable bump in the usage for web apps for Python 3 just doing that.
- 30:35So things like, you know, having it available.
- 30:36Yeah.
- 30:37Lowering the friction.
- 30:38Yeah.
- 30:39I think that's happening.
- 30:41I heard the Kenneth episode, actually.
- 30:43And he was saying, I wish Python.org would just decide which one the version is that they want to push and have that as the one that appears when you download.
- 30:50And that should be Python 3.
- 30:52And if you want Python 2, you should go and have to search for it.
- 30:55Because ultimately, I think, yeah, beginners are using Python 3.
- 30:58Educators are using Python 3.
- 31:00Hobbyists are using Python 3.
- 31:01Because, you know, why would you use the old version?
- 31:03Like, if you don't know any different.
- 31:05And so, Python 2 is kind of a legacy language.
- 31:08It just so happens that this is the one that 90% of professional Python developers use.
- 31:12But, yeah, I think we should make every effort, I guess, to start supporting Python 3 first for that sort of community.
- 31:18Yeah.
- 31:18He was talking about some really interesting ideas of, like, what is the killer feature we need to actually make people go, okay, it's time to switch.
- 31:25Like, removing the global interpreter lock.
- 31:27Maybe making, like, a super simple way to build distributable binaries that have no dependencies.
- 31:33I think those would be really cool things to work on.
- 31:35And I think it would make a difference.
- 31:37You brought up education.
- 31:39Yeah.
- 31:40And you guys are probably used a lot for students and people trying it out.
- 31:44Or there are, like, classes or university classes.
- 31:47Like, okay, go create your Python in your account to start your project.
- 31:49Yeah.
- 31:50Yeah, there are, actually.
- 31:51So, one of the things with Python is that it's the most popular education language for good reason, I think.
- 31:56It's just really straightforward.
- 31:58Like, you know, if you...
- 32:00I'm not Guido Van Rossum, but if you were to try and design the most obvious way of writing a programming language, that's how it is.
- 32:07Like, if you think about how a for loop works in Python versus C++ or JavaScript, you know, you just go, I just want to loop through these items.
- 32:15So, for each item in the thing, I want to do a thing.
- 32:17And you look at Python, that's actually it, isn't it?
- 32:20That's fantastic.
- 32:21So, for beginners, that's great.
- 32:22Like, the learning curve is really nice for Python.
- 32:24It's, you know, the Zen of Python is there.
- 32:26Within the language, that's great.
- 32:29So, that's working.
- 32:30Outside the language, there's some peripherals where it's not so good.
- 32:33I saw someone doing a poster about this at a PyCon three years ago.
- 32:38Just saying, you know, here's what beginners find hard about Python.
- 32:41Installing it is hard.
- 32:43Like, first, you have to choose between two and three.
- 32:45And then you install it on your system.
- 32:47And, like, I don't know if you've done this on Windows recently.
- 32:49I have.
- 32:49It's beautiful.
- 32:50Like, it doesn't add itself to the path.
- 32:52And it still doesn't add itself to the path by default, by the way.
- 32:55And so, then when people go, oh, just open up a command.
- 32:58Try to type Python.
- 32:59Like, it doesn't happen.
- 33:01Python not found.
- 33:02And, you know, it's like getting Python installed.
- 33:05And then people say, oh, yeah, you need pip to install packages.
- 33:07You know, so just, you know, apt-get install pip or brew install pip.
- 33:11And beginners go, what?
- 33:12What does this apt-get?
- 33:13You know, we've got Windows.
- 33:14Everyone's got Windows.
- 33:15We have no apt-get.
- 33:16And even the ones that have Macs, right, they go, oh, yeah, just install Homebrew.
- 33:19And they go, what's Homebrew?
- 33:20And they find a GitHub page, which is a terrifying thing, right, for beginners.
- 33:24And the GitHub page just says, oh, yeah, you just need to download Xcode, which is 1.1 gigabytes,
- 33:28just to be able to install this thing that's going to help you install this thing, right,
- 33:33that maybe you think you need.
- 33:34What is it, like, five Macs or something?
- 33:36I mean, how big is pip?
- 33:37I haven't even looked.
- 33:38It's totally small.
- 33:39Pip is tiny.
- 33:39But, like, to install it on a Mac, people tend to say, oh, yeah, use Homebrew.
- 33:42And then, so I have to, like I say, you have to hop by this 1.1 gigabyte thing,
- 33:47which is going to help you install this thing, which is going to help you install this thing,
- 33:49which finally is what you need to install this thing that you hope to use for some programming.
- 33:53And, yeah, people have given up by now.
- 33:55Yeah.
- 33:56I think people sometimes forget what is obvious to us now, but the things you get hung up on,
- 34:03like you're saying, like the path, you know.
- 34:05It would be no big deal to us.
- 34:07We could easily go do it.
- 34:08It's not fun.
- 34:09But to new people, they're literally out of luck, right?
- 34:12Yeah.
- 34:12It's like, what do I do?
- 34:13Yeah.
- 34:13Yeah.
- 34:14Yeah.
- 34:15And so you guys make that easier, right?
- 34:17Well, yeah.
- 34:17So teachers, you know, have to, if you're teaching Python, you have to, like, face that learning curve.
- 34:22And if you've got a bunch of students in a school, then you go, right, let's get Python on all the computers.
- 34:28Go.
- 34:28And then the school IT department goes, well, we're an IT department, so we say no to everything.
- 34:32It's our job.
- 34:34You know, or I don't mean, you know, there's great school IT departments out there, of course.
- 34:38But, you know, maybe that's going to take time or maybe, you know, whatever.
- 34:42Or you are, you know, teaching Python to a bunch of people out there, maybe adults, or they've got a disparate bunch of laptops.
- 34:49Some of them have got Windows.
- 34:49Some of them have got, you know, like, Macs.
- 34:51And you've got to try and make sure each one of them has got Python installed.
- 34:54And you've got to try and make sure each one of them has got a text data to install.
- 34:56And then you've got to be like, hey, if you're using sublime text, it looks like this.
- 35:00Or if you're using idle, it looks like that.
- 35:02Or if you're using a Mac, then type this command.
- 35:04If you're using a PC, type that command.
- 35:06And so, you know, a lot of people teaching Python is the first day has just been installing Python.
- 35:11And they go, well.
- 35:12Programming's not fun.
- 35:13Programming sucks.
- 35:14It's all about these little settings, right?
- 35:16Right.
- 35:16And so then if you just say to them, okay, well, forget all that.
- 35:18Like, if you go to Python anywhere, you need a username, you choose a password, and then go.
- 35:22Everyone has a text editor that works.
- 35:24Everyone has the same bash prompt.
- 35:26Everyone has the same version of Python.
- 35:28And everyone has the same packages all available and pre-installed.
- 35:31So if you want to do a class on NumPy, you can hit import NumPy.
- 35:34You don't even need to explain pip install.
- 35:36Yeah.
- 35:36You haven't even mentioned that on Windows, you might not have, like, the clang compiler or GCC or VSVars.bat.
- 35:46Yeah.
- 35:46VSVars.bat.
- 35:47That will literally stop the beginner in their tracks.
- 35:51If, like, the path thing didn't get them, that will definitely get them.
- 35:54Yeah.
- 35:54So that's great.
- 35:55So it's all set up.
- 35:56Even the stuff that's harder to install, like NumPy, are the things that have C dependencies.
- 35:59Yeah.
- 36:00So teachers, like, have been, you know, coming to us for that.
- 36:04And we've recently decided to try and do a little bit more for education.
- 36:08As education in Python worldwide becomes more and more popular.
- 36:13In the UK over here, the government have decided to make it part of the national curriculum.
- 36:17So they're saying that you have to teach it in schools.
- 36:19And this isn't just, like, you know, sort of secondary schools.
- 36:22It's, like, it's middle schools.
- 36:23So, you know, seven, eight, nine-year-olds are going to start to learn programming.
- 36:28And, you know, what can we do to try and, like, help teachers who, like, some of these teachers, they're not computing teachers, right?
- 36:36These are, like, generalist teachers who are just going, well.
- 36:38They might be a science teacher or something.
- 36:39I don't even like computers that much myself.
- 36:41I don't know if I, you know.
- 36:42So they're just trying to stay one week ahead of their students.
- 36:44And so if we can do something to try and make their lives a bit easier.
- 36:47So, yeah, we've been doing a bit of that recently, and it's been really cool.
- 36:50Yeah, it's really great.
- 36:51Last episode, I talked to a guy named James Curran.
- 36:55And in Australia, he's involved in the curriculum there for high school and said that in Australia, they're requiring a text-based programming language as part of the high school curriculum.
- 37:08Yeah.
- 37:08And so that really natural.
- 37:09Yeah, and he can't require two because we're sort of twice as good as Australians.
- 37:12Nice, yeah.
- 37:14So I think Python is the natural choice if they say text.
- 37:17You know, you can do Scratch or something like that for beginners.
- 37:20But as soon as it's, like, you've got to do a, quote, real programming language, I think Python is a good choice.
- 37:25Yeah, in the UK, it's equivocated.
- 37:26So people tend to teach HTML and Python, which, you know, you can have an argument about that.
- 37:32Yeah, my daughter's in their high school have a class called Web Coding, and they learn HTML.
- 37:36Yeah.
- 37:37I'm not sure HTML and coding go together, but whatever.
- 37:39They're doing something with computers, and it's cool.
- 37:41Well, CSS is true and complete.
- 37:43Accidentally.
- 37:44Accidentally.
- 37:45Nice.
- 37:47Okay, so talked about people getting started.
- 37:51That's great.
- 37:51Talked about the web hosting.
- 37:53Another thing that you're really into, and you were recently at PyCon last year, right?
- 37:58Mm-hmm.
- 37:59Or was it this year doing a workshop or tutorial?
- 38:01All the PyCons.
- 38:02All of them.
- 38:03Yeah, yeah.
- 38:03All of them.
- 38:04On testing, right?
- 38:05Sure.
- 38:05Testing a Django app.
- 38:06Yeah, yeah.
- 38:07Yeah, so that's my shtick.
- 38:08So I guess it was in 2009, 2010 that I started with Resolver and what became Python Anywhere.
- 38:16And I guess I'd learned enough Python and Django to be dangerous.
- 38:22And I'd built my first kind of web application for a client.
- 38:27And I remember how this went.
- 38:29Have you read Dive Into Python?
- 38:33I think I've skimmed it.
- 38:36I haven't read it all the way.
- 38:37To Dive Into Python is a good intro to Python for someone who already knows another programming language.
- 38:44And in about chapter 10, he starts talking about testing and test-driven development.
- 38:49And he goes, you know, we've learned about how Python works by RR.
- 38:52Now let me tell you a bit about testing and how you can write tests and how you can even write them first.
- 38:57And he uses a very traditional example, which is a Roman numeral translator.
- 39:01So let's build a function that can translate Roman numerals into integers.
- 39:05So like I is going to become 1 and II is going to become 2 and IV is going to become 4 and so on.
- 39:09And he goes, so, you know, imagine how you do that.
- 39:12And let me show you that if you actually, you can write tests for this.
- 39:15You can write a thing that says I should equal 1 and II should equal 2.
- 39:19And you can run that as a program which tests, you know, the thing you're about to write.
- 39:23And then when you write it, you know when you've got the right answer.
- 39:26And secondly, you know, you're going to be able to modify your solution and know that it's still correct.
- 39:30And I remember reading that and going, you know what, that's a really good idea.
- 39:33That sounds like something you really should do.
- 39:37It's like it's healthy.
- 39:38It's good for you.
- 39:38It's like flossing your teeth.
- 39:41And what happened next is I got my first real client and there were real deadlines.
- 39:46And all of my good intentions about TBD just went right out the window.
- 39:49And besides, by then I'd had a full seven or eight days of experience with Python and Django.
- 39:54You had it all figured out.
- 39:56I thought I was pretty smart.
- 39:57I figured I could get away without tests.
- 39:59And yeah.
- 40:00Yeah.
- 40:01Actually, I was fine.
- 40:02I was absolutely fine.
- 40:04Yeah.
- 40:05At first.
- 40:06And then.
- 40:07And then you started maintaining that thing.
- 40:09Yeah.
- 40:10Yeah.
- 40:10Yeah.
- 40:10Yeah.
- 40:10Yeah.
- 40:11I mean, you know, I read a thing about like called Don't Repeat Yourself.
- 40:14And I was like, right, well, I better not repeat code.
- 40:16And so like I started to that ended up being like sort of an inheritance class hierarchy, five levels deep.
- 40:22Did you hear that siren?
- 40:26Well, it's 4 p.m. on a Tuesday.
- 40:29So I guess that means it's a perfect time for a fire alarm test.
- 40:33It was ridiculously loud.
- 40:35Now, let's pick up the conversation again after ears stopped ringing.
- 40:38So you had written this app and it started out all fine.
- 40:42Then you heard about the derived principle.
- 40:45And you're like, yeah, that's a good idea.
- 40:46Let's do that.
- 40:46Yeah, yeah.
- 40:46Let's do that.
- 40:47Let's have an inheritance hierarchy, five levels deep.
- 40:49And like for some reason, I decided that like somehow I'd got to eval statements, right?
- 40:54So there was eval statements in the code doing stuff.
- 40:56And, you know, like it was no longer a one page app.
- 40:59You can just check works by like checking that one page.
- 41:01Like there was 25 pages and they were all interdependent.
- 41:04And I would change the thing over here and go, oh, I think I could.
- 41:07Oh, no, that's going to break that one over there, I think.
- 41:09So, but what?
- 41:09Maybe if I override this method.
- 41:11And like pretty soon I had like a nightmare of crufty code and I was scared to change it.
- 41:16And, you know, like all of those things happened to me.
- 41:18So, yeah.
- 41:18So then I got a job at Resolver and they went, you know, we do test driven development.
- 41:23I'm like, oh, really?
- 41:24Okay.
- 41:24Maybe that could help.
- 41:25But I still dragged my feet about it.
- 41:27But, you know, yeah, they showed me this thing.
- 41:29And so it's an extreme programming shop.
- 41:32Everything is pair programming.
- 41:33Really?
- 41:33That's cool.
- 41:34Yeah, yeah, yeah.
- 41:35I mean, it was like honestly so lucky for me to learn from these guys who've been doing it for ages.
- 41:41And, you know, if you're a pair programming and you just sit next to someone and they start asking programming and you just sit there going, why?
- 41:46Why?
- 41:47You know, and it's just like a sponge just sucking in all this knowledge.
- 41:52So it's an amazing way to learn.
- 41:56It's almost like an apprenticeship type of thing.
- 41:59Right.
- 41:59Yeah, I mean, that's really true.
- 42:00Yeah.
- 42:01And so that's, yeah.
- 42:02So I learned all this testing and I decided to try and kind of like regurgitate it a little bit and turn it onto some online resources.
- 42:11I made a couple of blog posts.
- 42:13I rewrote the Django tutorial.
- 42:14You have a website, right?
- 42:15Yeah.
- 42:15Yeah.
- 42:16It's called obeythetestinggoat.com.
- 42:19Fantastic.
- 42:20I used to have a website called tddjangotutorial.com.
- 42:23And what it was was like the official Django tutorial except test driven.
- 42:26So it tests at every stage.
- 42:27That's nice.
- 42:28And that turned into like a sort of tutorial I would do in real life and at conferences.
- 42:32And that eventually turned into a book which is published with O'Reilly.
- 42:36It's called obeythetestinggoat.com.
- 42:38Unfortunately not.
- 42:39No, I had, yeah, we discussed this with my editor and obeythetestinggoat is going to be too arcane a title.
- 42:45So that is actually the tagline or the subtitle.
- 42:48So the book itself is called test driven development with Python colon or comma obeythetestinggoat colon.
- 42:56And we actually argued about this.
- 42:58I wanted an exclamation mark but they insisted on a colon.
- 43:01So it's obeythetestinggoat colon tdd with Python, JavaScript, Django and pals or something like that.
- 43:06That's fantastic.
- 43:07So what kind of stuff do you cover in there?
- 43:09So yeah, it's test driven development but instead of taking that sort of classic slightly artificial example of a Roman numeral calculator which everyone does or a banking currency converter, right?
- 43:21There's always these TDD tutorials with like an example function and it goes, oh yeah, but it's nothing like the code you write in real life.
- 43:27It has no dependency.
- 43:28Right.
- 43:29It doesn't touch the file system.
- 43:30It doesn't have like a huge bunch of code calls, all that kind of stuff, right?
- 43:34And so I just did the opposite of that.
- 43:36I went like, okay, well let's do actual web development.
- 43:39And we'll just have all the dependencies.
- 43:40So yeah, it will be a web application which needs a web browser and it needs the file system straight away because of templates and there's going to be a database and all that is like from the ground up.
- 43:49But maybe that's a hideous mistake.
- 43:51I don't think so.
- 43:52I think a lot of those, I do a lot of training for my job and a lot of people have the same reaction that you were saying is like, it's all well and good to tell me about this stuff but this is a fake thing.
- 44:05It won't work in my complex company because X, Y, and Z.
- 44:08And if you don't see it for real, then who's going to believe it, right?
- 44:12So yeah.
- 44:13I mean, it's still a fake thing.
- 44:14I mean, I go through the development of a web application from scratch, but it's a simple web app, right?
- 44:20It's a to-do list app because that's everyone's example and I have no imagination.
- 44:25So it's the simplest possible web app, but it does have a database and it does use a web browser and it does do things to the file system and whatnot.
- 44:33Nice.
- 44:34So what are the testing frameworks and things?
- 44:39Like do you use pytest, Unitest, Nose, Clean Green?
- 44:44What's the story on it?
- 44:45It's been Clean Green.
- 44:48Nathan.
- 44:49I met Nathan who did this green testing framework.
- 44:52He's a lovely guy.
- 44:53His GitHub username is CleanCut and that's because he's just got the most preppy set of teeth.
- 44:59I think he's saturizing himself a bit.
- 45:04Nice.
- 45:04Yeah.
- 45:05No.
- 45:05So for the book, I just use the kind of standard air quotes tools, which are the UnitTest, Standard Library, Test Framework, and the Django Test Runner because that's what most people use.
- 45:19And at work, we use those as well.
- 45:23And we've also started experimenting a little bit with pytest.
- 45:26So there's a few talks out there if you look at it.
- 45:29I'm saying pytest versus Nose versus UnitTest.
- 45:32What are the pros and cons?
- 45:34And the Noses and pytest do come off well when they say, you know, like, UnitTest came from the Java world and this sort of like XUnit thing, which involves classes and it involves methods.
- 45:44And, you know, they've got these camel case method names, which is they've got them for historical reasons.
- 45:49And people new to Python will look at that and go, oh, that's weird.
- 45:52Why are we using camel case here?
- 45:53They don't look like methods on anything else I've ever seen.
- 45:56And so moving away from that, the pytests and the Noses who have a more just why have a class?
- 46:01There's no point.
- 46:02Let's just have functions because that's all we're really using these classes for.
- 46:05And that has a lot of appeal.
- 46:07And so I've dabbled with that and we've dabbled with that at work.
- 46:10And I think they're kind of cool.
- 46:11So I would definitely recommend people take a look at those.
- 46:14And particularly, I think pytest has got a lot of – I get the feeling that, you know, people have been out there and looked at these things.
- 46:19pytest is coming out as like the new kid on the block or the one where people go, yeah, yeah, yeah.
- 46:24Having assessed all three, this is the one to look at.
- 46:26What do you think the benefits are there?
- 46:28Is it more Pythonic?
- 46:30Yeah.
- 46:30Is it easier to use?
- 46:31Yeah.
- 46:33So those two things, for example.
- 46:35Yeah.
- 46:36You know, like so in unit test, you're going to have – you know, you go, well, if I write a test without any framework, I go assert thing equals three.
- 46:45Right.
- 46:46This is actually – I do this in the book to explain why would you use a test framework.
- 46:49And you go assert thing equals three and it fails.
- 46:52And you get a thing saying assertion error.
- 46:53But it doesn't say, well, thing you expected was three was actually equal to four.
- 46:57That would be useful.
- 46:58That would be great.
- 46:58So you can write your own error message handler, right, by, you know, using the sort of comma second argument to the assert keyword.
- 47:05But that's hard work.
- 47:06And you know what?
- 47:07People have discovered these problems before and there are standard solutions.
- 47:09And one of them is use unit test, put in a test method.
- 47:12You get set up and tear down, which is a common requirement in tests.
- 47:15And you can go self.assert equal thing with thing and then it's going to give you a nice error message.
- 47:20And I think that's all very well.
- 47:22But you've gone through the trouble of making a class and making a test method.
- 47:26And you're – I think Raymond Hesinger was saying the other day about Pepe's indentation.
- 47:30You know, when you've written a test class, you're already three levels of indentation down before you've written any test code.
- 47:35And you're going to go self.assert equal.
- 47:37And there's also self.assert items equal if you just want to compare list items without the order.
- 47:43And you've got self.assert is none.
- 47:45And you've got assert multiline equal for strings.
- 47:47And you've got assert rejects matches.
- 47:50You've got assert – you know, like I can't even remember them, right?
- 47:53Yeah.
- 47:54And so you have to start looking at the docs whenever you're trying to compare two things.
- 47:58And I think pytest is superior to that in which they just go, look, just say assert and then a thing.
- 48:03And the test framework will figure out what the thing was you were asserting.
- 48:07And it will try and give you a sensible error message without you having to be clever about it.
- 48:11Yeah, that's fantastic.
- 48:11And I really like that.
- 48:12Just the assert keyword that you've seen before and a thing.
- 48:15And other than that, you just put your tests in methods that start with test.
- 48:18There's no need for a class unless you really want one.
- 48:20Sure.
- 48:20Very nice.
- 48:22Well, I've been using unit tests.
- 48:24Maybe I should be checking out pytest.
- 48:25Yeah.
- 48:26So you can run pytests on existing unit test tests.
- 48:29Yeah.
- 48:30And so there's a migration path there that will work.
- 48:32And then the weird thing.
- 48:35So the fact that the assert keyword, it will magically tell you what the two values were,
- 48:40is the first bit of pytest magic that people raise their eyebrows at a little bit.
- 48:45The really magic part is the way it does sort of set up and tear down.
- 48:49Which is, you know, in unit tests, we write a methodical set up and a methodical tear down.
- 48:53And that seems instinctive to us now because we're so used to it.
- 48:56It's been beaten into us over the years.
- 48:58But what we really want, and so that the pytest world is more kind of functional.
- 49:01And what they say is, okay, well, if you want some setup to be done in a test,
- 49:06you're going to define a method that does that setup.
- 49:07Well, define a function that's going to do that.
- 49:10So you define a function that says, like, prepare database, for example,
- 49:14that's going to, like, set up a test database for you.
- 49:15You do some stuff.
- 49:17And then if that function is called prepare database, you put a decorator on it.
- 49:22Say this is a fixture.
- 49:23pytest's word for test setup stuff is a fixture.
- 49:27Which is slightly different from the way Django uses the term, but bear with us.
- 49:31Pop a decorator on it.
- 49:34And then take any of the tests that need that fixture.
- 49:37And then you just say, add an argument to that test.
- 49:39Which, first of all, that function didn't have any arguments.
- 49:42Now, you add an argument to that test.
- 49:43And you just give that argument the same name as the function you'd find earlier.
- 49:45And then when you run it, we'll magically find that function, execute it,
- 49:49and inject it into your test for you.
- 49:50That is magic.
- 49:51That is magic.
- 49:52Or a crazy convention.
- 49:53Well, or a convention, right?
- 49:55And, I mean, setup and teardown are kind of magic as well.
- 49:58Like, there is something happening to make those happen.
- 50:00Yeah, absolutely.
- 50:01And so, like, is it any more explicit?
- 50:02That's debatable.
- 50:03I think it's just...
- 50:04No, it sounds great to me.
- 50:05But then you can have fixtures inheriting from fixtures.
- 50:08So, if you have a fixture function called prepare database,
- 50:11maybe that inherits from prepare file system.
- 50:13And so, similarly, you can give an argument to a fixture that's also another fixture.
- 50:17And, you know, like, yeah, yeah.
- 50:19It'll get...
- 50:21It's like a Russian doll.
- 50:22It'll get pretty fun pretty quickly.
- 50:23Yeah, that's very cool.
- 50:24So, do you discuss code coverage?
- 50:28I don't, no.
- 50:30It's a lacuna.
- 50:34I guess we've never used it at work because we've got such a sort of religious adherence to TDD.
- 50:39The guy next to you is the code coverage.
- 50:41Well, they are.
- 50:42And the methodology is in that, like, we basically don't allow ourselves to write any code in production that hasn't got a test.
- 50:47So, you know, we've kind of assumed our coverage is 100%.
- 50:51And so, it would be probably educational for us to actually run coverage one of these days.
- 50:57But, no, I don't talk about it in the book.
- 50:59I mention it at the end going, hey, here's the thing you should check out.
- 51:01Yeah, here's the thing you should check out.
- 51:02That's cool.
- 51:03You know, you can't cover everything.
- 51:04Yeah, no, of course.
- 51:05You have to ship.
- 51:07Even when it's a book, you have to ship at some point.
- 51:09Yeah, yeah.
- 51:09It's the trouble of anyone writing a book.
- 51:11But, no, I do find that.
- 51:12So, I talked about it being real.
- 51:14In the book, we build a to-do list app.
- 51:16So, we go ahead.
- 51:17We learn how to database to-do list.
- 51:19We start with a to-do list app that has, like, one item.
- 51:21Then it has many items.
- 51:22But it's the same list for everybody on earth.
- 51:24And then there's, like, multiple lists for multiple people.
- 51:27Great.
- 51:27And then, like, once we've got that working, I go, okay.
- 51:30Well, you've made a really ugly website.
- 51:31Let's do some styling.
- 51:32Because, like, it's not just about a Django view that returns horrible HTML.
- 51:36Let's put Bootstrap on there and use CSS and make it look a bit presentable.
- 51:40Which is something that, you know, most guys might not cover.
- 51:43And then that's Chapter 7.
- 51:45And then Chapter 8.
- 51:46I'm like, right, good.
- 51:46We've built a basic web light.
- 51:47It's fine.
- 51:48I know you can't delete to-do items.
- 51:49You can't edit existing ones.
- 51:51But that is a working to-do list app.
- 51:52It's a minimum viable product.
- 51:53So, now we need to ship it.
- 51:55And so, like, Chapter 8 is deploy it to a server.
- 51:57And I'm just going to go through how, like, now that you've got your tests, can you run them against a server?
- 52:02Can they actually help you deploy as well?
- 52:04And so, yeah, that gets even more real, I guess.
- 52:07Yeah, very cool.
- 52:09And a fairly fierce learning curve.
- 52:11Yeah, it seems like a good place for people to start.
- 52:13So, I'll put a link in the show to the book.
- 52:16So, thank you.
- 52:17Yeah, so you were talking about databases and dependencies.
- 52:20And I'd like to come back to Python anyway to start a bit and talk about that a little bit more.
- 52:24So, you guys have MySQL.
- 52:29Sure.
- 52:29Your Postgres.
- 52:30Yeah.
- 52:30Postgres.
- 52:30And then I noticed something interesting, I think, in an email from you guys.
- 52:37I think I'm remembering this, right?
- 52:39So, now you're using containers.
- 52:40Oh, yeah.
- 52:41For your Postgres.
- 52:42Sure.
- 52:43Yeah.
- 52:43So, is that Docker?
- 52:44The Postgres ones are, yeah.
- 52:46Yeah.
- 52:46Yeah.
- 52:47Yeah.
- 52:47Well, so I guess anyone that's building a thing a little bit like what we're building eventually comes across containers.
- 52:52Like, this is .cloud.
- 52:54We're in a similar business and they invented Docker.
- 52:55Yeah.
- 52:56So, if you're running a lot of people's untrusted code on your servers, you've got to figure out a way of isolating them.
- 53:02And the way you do that in Unix is with a bunch of cool tools that put together a tool these days,
- 53:07containerization.
- 53:07So, we've used bits and pieces of these tools everywhere.
- 53:10And the thing with MySQL is the way we provide that is if you host a MySQL server, you can do multi-tenancy fairly easily.
- 53:22You can create different user accounts for different users and you can say this user has permissions on this database and this user has permissions on that database and you're fine.
- 53:30They're pretty well sandboxed from each other.
- 53:32Postgres isn't so good in that respect.
- 53:36It's not really designed with a multi-tenancy model in mind.
- 53:40And pretty much in Postgres, unless you've got super user access to the server, you can't really do anything.
- 53:45And none of the cool Postgres stuff is possible without being a super user.
- 53:50So, you can't really do multi-tenancy Postgres.
- 53:54So, we were forced to say, okay, well, then we can't just have one Postgres server that runs everyone with user accounts on the same server.
- 54:01We're going to have to have multiple servers.
- 54:03Everyone's going to have to effectively be a super user in there.
- 54:06And a sensible way of doing that seemed to be to run each Postgres instance in some sort of container.
- 54:11Yeah, that's really cool.
- 54:12A virtual machine probably wouldn't be the right answer.
- 54:14Yeah, too slow, right?
- 54:15I mean, this is why everyone's using containers.
- 54:17They're too expensive.
- 54:18The density on the servers just isn't there.
- 54:20Yeah.
- 54:21If you're offering something for free, density matters.
- 54:23Yeah.
- 54:23Yeah.
- 54:24Yeah.
- 54:24So, that was nice.
- 54:26So, that was where, yeah, we used Docker for the first time in production and we used Py.Test for the first time in production.
- 54:31So, the Py.Test and Docker, like two experiments at the same time.
- 54:34Terrible idea.
- 54:34Great fun.
- 54:35Sounds excellent.
- 54:36And, yeah, so that's how that works.
- 54:38We've been happy with it.
- 54:39Uh-huh.
- 54:39Cool.
- 54:40And I saw on your features you're considering maybe sometime maybe was MongoDB.
- 54:47Yeah.
- 54:48Would that be a thing that might show up over there?
- 54:50It might be.
- 54:50I think we're looking in the short term to probably outsource that.
- 54:54So, there's, I can't remember, there's a couple of companies out there that do MongoDB as a service.
- 55:00Sure.
- 55:00MongoHQ, MongoLab, ObjectRocket.
- 55:03There you go.
- 55:04All of these guys.
- 55:04I think I'm going to say the three that come to my mind.
- 55:06Well, I, you know, since we haven't settled on it, we won't big up any of them in particular today.
- 55:10Yeah.
- 55:10Because maybe they'll give us a good deal or something.
- 55:11Yeah, exactly.
- 55:12It's time for a bidding war.
- 55:13Yeah.
- 55:15So, I think what we do for Mongo maybe in the short term is pick one of those, try and build a bit of integration, just make it really easy for people to go, oh, okay, start a Mongo service.
- 55:22And it will actually go out to, you know, whoever it will be.
- 55:24Sure.
- 55:25Create a user account on there.
- 55:26And then, you know, wrap it up.
- 55:27Just kind of delegate, wrap it up, make it amazing.
- 55:29Yeah, that's cool.
- 55:30And a lot of those guys are either on AWS or direct connect to AWS.
- 55:34So, it would be relatively.
- 55:35Yeah.
- 55:36So, that's one of the fun things about Python Anywhere, actually, is if you ever do a Git clone of a massive repo and you're sitting there and it's going, okay, downloading 400 megabytes or more, not everything is fast on Python Anywhere.
- 55:51But that is one of the things it is because it's in Amazon's data centers and GitHub's got some servers right next door.
- 55:56Yeah.
- 55:56When you get a repo, it comes down super fast.
- 55:59Yeah.
- 56:00Which is great.
- 56:00Yeah.
- 56:01I mean, other file system things aren't so fast because we have to have the challenge of running multiple servers but needing to give people access to the same file system no matter what server they're on.
- 56:10You know, there's NFS in the background and that's not the fastest thing ever.
- 56:13Yeah, of course.
- 56:14But, yeah.
- 56:14No, for doing internet stuff, being in a data center in the first place is great.
- 56:18That's cool.
- 56:19And that's how I get my source code onto the machines.
- 56:22I just get, you know, get pull.
- 56:25I've cloned it, set up my virtual environment, point it at the Git repo.
- 56:28Yeah.
- 56:29Yeah.
- 56:30Is there a way to set up continuous delivery?
- 56:32Yeah.
- 56:33Yeah?
- 56:33So you can, continuous delivery, so you can hack it a little bit.
- 56:37Yeah, like with a web job to do a Git portal?
- 56:40That sort of thing, yeah.
- 56:41You could do that.
- 56:42But you can, you can, you can set up, because like Python Anywhere is essentially a Linux server, you can set up a Git repository on it, one that you can push to.
- 56:55So there's a, we've got a blog post about this, but you can set up a Git repository that will, that you can push to, set it up as a remote in your own local computers one.
- 57:03And then you can do Git push Python Anywhere.
- 57:05It'll arrive on Python Anywhere.
- 57:06You can set up some hooks on Python Anywhere.
- 57:08When they see new code coming in, maybe they'll even run your tests.
- 57:10And then they can do a little thing that will like bounce your web workers and, and your website will be deployed.
- 57:16Nice.
- 57:17So you can, you can sort of hack it.
- 57:18So we haven't built that in yet.
- 57:19But you can, you can hack around a thing like that if you feel like it.
- 57:23Yeah.
- 57:23Cool.
- 57:24Is that something you're considering?
- 57:26Maybe, maybe not?
- 57:28Well, we always have to think, you know, we have to serve, we have to serve the beginners and we have to serve the more advanced people.
- 57:34Right.
- 57:34And so the model is.
- 57:35That what I'm describing is not very much in your original mission.
- 57:38Right.
- 57:38Yeah, yeah, yeah.
- 57:39So like continuous deployment, right, as a thing is not the first thing, you know, it's not the first hurdle that people walk up to.
- 57:46And so we like, we'd run, I think maybe for now we'd rather like say, can we make it easier for people to use virtual M's or can we make it easier for people to upgrade their version of Django?
- 57:55If they're a beginner, we're like trying, trying to make that learning curve a bit smoother.
- 57:59Yeah.
- 58:00It seems like that kind of stuff would actually be way more broadly valuable.
- 58:04Yeah.
- 58:04I don't know.
- 58:05It's different audiences, right?
- 58:06Yeah.
- 58:07Not necessarily to me because I'd like continuous integration as a button, but our continuous delivery.
- 58:11But for most people will come.
- 58:13It seems like that would be the right place to focus.
- 58:16Yeah, yeah, yeah.
- 58:17I mean, there's so many things.
- 58:19It's hard to prioritize.
- 58:20That's a good problem to have, right?
- 58:22There's all this cool stuff you want to do and you got to pick.
- 58:27Yeah, yeah.
- 58:28So, you know, see what your users are asking for, right?
- 58:32Yeah, IPython notebooks they want.
- 58:34And we're trying to try to figure out what people are doing.
- 58:36Oh, yeah, that would be cool.
- 58:36Yeah, yeah, yeah.
- 58:37I mean, it is.
- 58:38You're getting IPython running in your local computer isn't totally straightforward.
- 58:41It's not, especially on Windows because you've got some C dependency somewhere or whatever.
- 58:45There are, there's anacondas.
- 58:46Right, that's true.
- 58:47Yeah, some of the prepackaged environments.
- 58:50Before that, there was the M4 scientific Python distribution.
- 58:53It's all the same problem.
- 58:55Like, yeah, there's the things that should be easy that aren't.
- 58:57And so, yeah, yeah.
- 58:59We're going to see what we can do about it.
- 59:00Yeah, so if you make that open web browser click button, that'd be fantastic.
- 59:04Yeah, yeah, yeah.
- 59:05Nice.
- 59:07So, I think that's kind of getting to be a decent amount of stuff we've covered in the show.
- 59:12Anything else you want to add?
- 59:14Now, I promised myself I was going to say a thing and it's gone.
- 59:21Let me ask you something else and maybe it'll sneak back into your subconscious.
- 59:24So, one of the things I ask a lot of the guests on their way out the door is what is your sort of favorite package or library in Python?
- 59:31Do you have some favorites?
- 59:33You know when you type in pip install requirements.txt and it goes no package called this point requirements.txt?
- 59:41Because you have to type in pip install -r requirements.txt.
- 59:45Yeah.
- 59:46Right.
- 59:46I've been trying for a little while to figure out if I can upload a package to PyPI called requirements.txt somehow.
- 59:53So, that when you accidentally mistype pip install requirements.txt, it installs my package.
- 59:58And because the setup.py is like, you know, completely unsecure.
- 1:00:02It's just straight.
- 1:00:02You can do whatever you want.
- 1:00:03I was just going to open up Firefox to rickroll people.
- 1:00:09So, that pip install requirements.txt would just rickroll you.
- 1:00:11I think that would be great.
- 1:00:12I think the PyPI guys have got there ahead of me on that.
- 1:00:16So, it's not possible that I've found.
- 1:00:19But I thought I'd throw that little evil idea out there in the world to the listeners of the podcast.
- 1:00:23If you guys can figure it out, it would be hilarious.
- 1:00:25That would be great.
- 1:00:25Maybe slight misspellings of the word requirements.
- 1:00:28Yes.
- 1:00:29Get them like 10% of the time or 5% of the time.
- 1:00:32Maybe requirements text without the dot.
- 1:00:34Yes.
- 1:00:35Right.
- 1:00:35You could maybe catch a few people like that.
- 1:00:37That's fantastic.
- 1:00:39All right.
- 1:00:41Final thoughts.
- 1:00:41Have you thought of it?
- 1:00:42I know.
- 1:00:43That was it.
- 1:00:43I think that was actually the rickroll thing.
- 1:00:44That was the rickroll.
- 1:00:45Awesome.
- 1:00:45I must bring that up.
- 1:00:46That's fine.
- 1:00:47Yeah.
- 1:00:47That's really good.
- 1:00:49So, Harry, thank you so much for being on the show.
- 1:00:51Yes.
- 1:00:52It's really interesting.
- 1:00:53I'm a huge fan of Python Anywhere.
- 1:00:55If someone's out there listening and they're like, that sounds cool.
- 1:00:59I want to check it out.
- 1:00:59I want to play with this idea of a bash shell in my browser.
- 1:01:02Whatever.
- 1:01:04How do they get started?
- 1:01:06So, pythonanywhere.com.
- 1:01:07Python, P-O-I-T-H-O-N, anywhere, N-A-N-Y-W-H-E-R-E.
- 1:01:12Or you can go to pythoneverywhere.com.
- 1:01:14That redirects to pythonanywhere.com appropriately.
- 1:01:16You can also go to python.org.
- 1:01:18There's a little Python console on the front page there.
- 1:01:21You can click the button.
- 1:01:22You get a live console.
- 1:01:22That's supplied by us if you feel like it.
- 1:01:25And the other thing I have to plug or my editor will kill me.
- 1:01:28I'm going to plug my book.
- 1:01:29So, the book is available at obeythetestinggoat.com.
- 1:01:32It's available both for free and for purchase.
- 1:01:35So, the whole thing is available online for free for the zero pounds or dollars or anything.
- 1:01:41But if you feel like buying it, you can as well.
- 1:01:43And, yeah.
- 1:01:46Those are the two websites that you have to go to.
- 1:01:48pythonanywhere.com.
- 1:01:49Obeythetestinggoat.com.
- 1:01:51And your testing tutorial you did at PyCon is on YouTube, right?
- 1:01:57Sure.
- 1:01:58Yeah, yeah, yeah, yeah.
- 1:01:59Is that just in the...
- 1:02:00I think I actually have it in my list.
- 1:02:01In one of the previous shows, I said, like, here are the essential presentations.
- 1:02:05Yeah.
- 1:02:06From PyCon 2015.
- 1:02:07And I think it's in there.
- 1:02:08But I'll put a direct link to it in the show as well.
- 1:02:10For sure.
- 1:02:11Yeah, yeah.
- 1:02:11I mean, there's an O'Reilly official video you can buy.
- 1:02:14Okay.
- 1:02:15Maybe I'll link to that as well.
- 1:02:16You can if you want.
- 1:02:17But, you know, there are also free versions of all these things.
- 1:02:19I'm no great believer in, you know, this is the internet.
- 1:02:22This point is pretending that you can charge for digital things and that people won't find a way of getting them for free if they want them for free.
- 1:02:29So I'm all about saying let's have them for free.
- 1:02:32You know, your choice is between having it for free without your consent and having it for free with your consent.
- 1:02:37And my choice is with my consent.
- 1:02:38So help yourself to the stuff for free and pay for it if you feel like it.
- 1:02:41Yeah, that's great.
- 1:02:42I think people are more generous than a lot of businesses give them credit for.
- 1:02:47And they're, you know, they'll say thanks and they'll buy something if it really helped them.
- 1:02:51Well, so we're in danger of overstepping the end of the podcast here.
- 1:02:55But I'm sort of a bit into internet activism.
- 1:02:59I'm a member of the Pirate Party here in the UK.
- 1:03:01And for me, it's worked very well.
- 1:03:04Like I say, put my stuff online for free and people will pay for it.
- 1:03:06And so I would love to expose that as an ideology.
- 1:03:09I would say that it's a different calculus for me than it is for Stephen King.
- 1:03:18If I put my book online for free, the people that read that, why are they reading a book about test-driven development for web development, right?
- 1:03:25They're not reading that like to…
- 1:03:28It's not a scary…
- 1:03:28This is not a holiday airport thriller, right?
- 1:03:31This is a thing they're reading.
- 1:03:32They're reading because they want to get better at programming and they want to get better at programming because they're probably doing it for a job for money, right?
- 1:03:38So I think people see the very act of reading that book as quite a commercial transaction.
- 1:03:42And when I'm saying, hey, look, it's try before you buy.
- 1:03:45Like, so read this.
- 1:03:46If you get value out of it, you know, I'd love it if you paid.
- 1:03:48I think people do go, well, I was reading this in the first place for monetary reasons, so I think I should probably pay.
- 1:03:53Whereas, you know, like if Stephen King is sitting there putting all his books for free out there, you know, you're reading that.
- 1:03:59You're not reading it for monetary reasons.
- 1:04:01Your personal value of it is not the same as if it means a better job.
- 1:04:03Exactly.
- 1:04:04So maybe it's easier for me to upsell people to the paid version than it would be for Stephen King or something.
- 1:04:11But yeah, no, absolutely.
- 1:04:11It works for me.
- 1:04:12That's cool.
- 1:04:13Great.
- 1:04:13All right.
- 1:04:13Well, thank you again so much for being on the show.
- 1:04:15It's really nice to meet you.
- 1:04:17And I think it'll be a great conversation for everyone to listen to.
- 1:04:20Great.
- 1:04:20Thanks, Michael.
- 1:04:21Yeah.
- 1:04:21Bye.
- 1:04:22Bye.
- 1:04:22Bye.
- 1:04:22Bye.
- 1:04:22This has been another episode of Talk Python To Me.
- 1:04:27Today's guest was Harry Percival.
- 1:04:29Follow him on Twitter where he's at H-J-W-P.
- 1:04:33This episode has been sponsored by CodeShip.
- 1:04:36Please check them out at CodeShip.com and thank them on Twitter via at CodeShip.
- 1:04:41Don't forget the discount code for listeners.
- 1:04:43It's easy.
- 1:04:44It's Talk Python, all caps, no spaces.
- 1:04:46Remember, you can find the links from the show at Talk Python To Me.com slash episodes slash show slash 10.
- 1:04:54And if you're feeling generous, check out our Patreon campaign at Patreon.com slash mkennedy.
- 1:05:01Be sure to subscribe to the show.
- 1:05:03Visit the website and choose subscribe in iTunes or grab the episode RSS feed and drop it into your favorite podcatcher.
- 1:05:09You'll find both in the footer of every page.
- 1:05:12This is your host, Michael Kennedy.
- 1:05:14Thanks for listening.
- 1:05:15Thanks for listening.
- 1:05:15Bye.
- 1:05:16Bye.
- 1:05:17Bye.
- 1:05:17Bye.
- 1:05:18Bye.
- 1:05:19Bye.
- 1:05:19Bye.
- 1:05:20Bye.
- 1:05:21Bye.
- 1:05:22Bye.
- 1:05:23Bye.
- 1:05:24best.
- 1:05:24First developers.
- 1:05:26First developers.
- 1:05:28First developers.
- 1:05:29First developers.
- 1:05:31First developers.
- 1:05:32First developers.
- 1:05:33First developers.
- 1:05:35Don't forget.