Brought to you by Rollbar - Detect, diagnose, defeat errors w/ pip install rollbar


« Return to show page

Transcript for Episode #19:
Automate the Boring Stuff with Python

Recorded on Thursday, Jul 2, 2015.

You know, some of the things we do in life are tedious and boring. They are the kind of things that machines or maybe robots could do. So let's build those machines! This is Talk Python To Me and we'll be automating the boring stuff with Al Sweigart.

It's show number 19, recorded Thursday, July 2nd, 2015

[music]

:43 Hello and welcome to Talk Python To Me, a weekly podcast on Python- the language, the libraries, the ecosystem and the personalities. This is your host, Michael Kennedy, follow me on Twitter where I am at @mkennedy and keep up with the show and listen to past episodes at talkpythontome.com. Also, follow the show on Twitter where it is at @talkpython.

1:06 This episode, we'll be talking with Al Sweigart, author of "Automate the Boring Stuff with Python" practical programming for total beginners and founder of Invent with Python- inventwithpython.com.

1:17 This episode is brought to you by Hired and Codeship. Thank them for supporting the show at Twitter via @hired_hq and @codeship.

Now, before we get to the show I do have to apologize for my audio on this one, the gain on my mic got bomped and unfortunately I didn't notice until after the interview. Luckily, Al's audio is grat, and I let him do most the talking, so it's not too bad, but the quality is definitely below the bar I tried to set for the for the show, so I am sorry about that.

1:49 Now, let's get to the show.

Let me introduce Al. Al Sweigart is a software developer and technical book author living in San Francisco. Python is his favorite programming language, and he is the developer of several open source modules for it. His other books are freely available under the creative common's license on his website Invent with Python- inventwithpython.com. His cat weighs 14 pounds.

2:12 Hey Al, welcome to the show.

2:14 Hey, thanks for having me.

2:15 You bet. You've got a big cat man.

2:17 Oh, yes. In chapter 17 which deals with image manipulation I use a photo of her and she looks especially rotund, in that photo, but I have her on a diet now so she is down to 13 pounds.

2:33 Oh, at least it is going that way, that's cool, I love big cats.

2:36 Oh yeah, I'm pretty sure she might be like two cats under a trenchcoat standing on each other's shoulders maybe, that could account for the weight.

2:43 Yeah, that's the most likely scenario I think. Al, welcome to the show- today we are going to be talking about your new book "Automate the Boring Stuff with Python", and you just released this, right?

2:54 That's right. It came out this past April, I've been working on it for about a year and a half beforehand, and in fact of March 2014 I left my software developer job to start writing full time.

3:08 I think that's a really brave but awesome thing to do.

3:10 Yeah, it was a calculated risk, I mean for the decade beforehand I had always been working a safe 9 to 5 job so I had some money saved up so I thought "well, now is the time to start taking some risks."

3:25 That's right. The whole learn a code thing is hot, it probably had a place in your life where you were able to take that time and focus and so on, right?

3:33 Yeah.

3:33 So we are going to talk all about your book, and some of the other projects you've got going on. But before we get there, how did you get into programming in Python, what's your story?

3:42 So I started programming sometime in the third grade, and I really don't like telling that story, because it's sort of reinforces that like- Oh no, you have to start programming when you are a little kid, or you know, just as soon as you develop motor skills or something, if you want to get good at it. So I always follow that up with all the programming knowledge that I gained between the third grade when I started and probably freshman year of university- you could probably learn that in every weekend for a few weeks. So, it didn't really give me that much of a boost, but it was definitely something I'd been interested in for a while. So I had started with Basic and I found this one book that was really great at teaching me how to program.

4:31 And this was you know, before Google and before you could easily find a lot of information. I didn't even really know that I was specifically looking up books on programming, because whenever I went to library and thought, Ok, I'll just find computer books, they would just be sort of abstract and say like, "oh, this is the CPU and this is the printer and this is the keyboard...", and that sort of thing it wouldn't actually be talking about the loops and variables, and other things like that. But this one book I found, it was great, it just gave me the source code for all these small little games, and just from that I was able to copy that code and then make tiny adjustments to it.

So a few years ago, a friend of mine was the nanny for this precocious ten year old who wanted to learn how to program, so I tried to find some tutorial on programming like that, but I really couldn't find anything. So I just started writing up a short Python tutorial and that just eventually ballooned into book length, which I just self published. And people seem to really like it, so I wrote a second one, and then a third one...

5:35 Now you have a habit.

5:38 Yeah. I kept thinking like, "Ok this will be the last book I write", and then "Oh well, I've got to come out of retirement to pull off one last taste." So, that was "Automate the Boring Stuff with Python".

5:51 Yeah, that's really cool. What was the name of the original book?

5:54 The original book that I've found was "Invent your own computer games". And back before I realized that this could actually become a huge book, so my first book was just "Invent your own computer games with Python". By the time it had blown up a little bit, I already was kind of stuck with that name but it's worked out pretty well.

6:14 Yeah. That's awesome. I think it's really inspiring to help young people to kind of get started. It sounds like that's where your book came from-

6:23 Yeah, it's really great to get emails from people who say, "I'm 14 years old and I want to learn how to code". And I essentially copied the style of that book, of just having the complete source code to small programs instead of only talking about programming concepts abstractly and then leaving it up to the reader to put all those concepts together to actually make something fun.

6:47 Yeah I think one of the hugest problems learning to program- and it doesn't really matter whether you are a kid or not, in order to do anything that is interesting or seems like you've accomplished something, you have to learn a bunch of little tiny facts.

7:02 Oh yes.

7:03 Yeah, I've got to learn what a for loop looks like, I've got to learn how to declare variables, I have to learn how to import modules, and you've got a power through that stuff. And somehow in your mind, you have to say, "There will be something good on the other side". And I think the kind of stuff that you're proposing gets- you know, shortens that gap and so it's- fewer people are likely to drop out I guess.

7:25 Yeah, I mean, I definitely try to keep in the first book all the little game programs anywhere between 50 and 200 lines of code, I don't think any of the programs are more than 200 lines of code. Just because you don't really have to have that much code to make something a lot of fun in Python is actually great about this. When I started writing up like a hangman program or tic tac toe program, I realized, "Oh well, if I had written this in Basic or in some other old programming language, this would have been probably about 3 or 4 times as long and just that much more that I would have to explain in the book and I would lose another standard deviation of readers".

8:07 That's right. Here is how you import the header file and here is how you link the static library, and like- what then?

8:14 And just type out public static void main string arcs bracket, bracket- we'll go into "why" later, yeah. Python's great, just, you know- "hello world" is one line.

8:24 Yeah, Python is great. What I really think is cool about it, is it's appropriate for this like my very first experience in programming, and as you probably know, Python is now the most popular language for first year programming courses at universities in the US at least. Right?

8:39 Oh right.

8:41 That's awesome.

8:43 It's eclipsed Java in that regarding.

8:45 Thankfully. And it's also appropriate for Instagram. And it's appropriate for Disqus, and it like to use huge scale professional things. So the fact that it's a spectrum that you don't like ok I'm going to learn Scratch until I want to put on my big boy pants and then I've got to go learn Java right, it's this continuum that it's wonderful I think.

9:08 Yeah, I mean so Python as you might know, was just based off of this language ABC which was developed as a teaching language, and it turns out that making a language's syntax just easy and readable is not just good for beginners but just a good idea in general.

9:26 Right. It basically comes down to the realization that code is read way more than it's written.

9:31 Oh yes definitely.

9:32 Yeah, definitely. So, let's talk a little bit about your book and some of the topics that kind of surround it.

9:39 Sure.

9:41 Yeah. So, one of the things that you said is people feel like that programming is something like intimidating rocket surgery and it's scary. But probably it shouldn't be. What do you think about that?

9:55 It's yeah, programming definitely has that sort of you know, you have to be a genius in order to understand this and I suppose a lot of people are less intimidated by computers these days, just because they are more familiar, but the idea that I can write software just like Mark Zuckerberg or Bill Gates can write software, and you think that you have to be a genius in order to program a computer and then that goes on to create a billion dollar company or anything like that.

10:28 Whereas you know, there is a wide spectrum where you could just write little scripts using some a few programming concepts, and these scripts can actually be pretty useful so I started thinking about well what kind of things could a typical office worker write I mean a lot of my non programming friends would tell me you know like, "Today at the office I spent 4 hours going through a couple hundred excel spreadsheets and copying and pasting this one line out of all of them" and I would think to myself like "oh wow you could probably have written a script to do that in 20 minutes and it would have taken about 2 seconds to run and you would have been finished and saved yourself an entire day of work".

11:10 That's right. Not just that day, but every day going forward.

11:14 Yeah, exactly.

11:13 In your book you have a cool story about some college roommates working in retail, do you remember that, can you tell it?

11:22 Oh yes. So this story is at the very beginning of the book, it's one of the things that I remembered when I started writing this. This was I think my sophomore year college roommate, he was telling me about how he was working at this one retail outfit and every once in a while, they would get a huge spreadsheet of product prices of their competitors. I didn't ask how they got the spreadsheet, but they would have to go through and type in each product's que into their database to find their price and then they would have to compare the prices and they just mark it out on these massive printouts that they've made of hundreds of pages, and it would be 2 or 3 of them just doing this for two days straight and going through and then just checking to see which prices they should lower.

12:15 And he said "well if you have the original file that you've printed these pages out from, I could probably just write a script to go through and automatically do this" And so it took him like couple of hours and he was mostly just consulting documentation and trying to remember how to do various things in C but eventually he just hacked out a tiny script I mean, it was basically looking this spreadsheet looking this database and then just see which one is higher and then print out the relevant ones to the screen. So you know, after a few hours of just writing that code and he ran it and it only took a few seconds to run, and basically it just sort of saved everybody multiple people a couple of days of work.

13:03 Yeah, that's fantastic.

13:03 Yeah, and so computers are- at this point everybody is familiar with or has access to computers, lots of people have laptops, lots of people have mobile phones, but a lot of people don't get the maximum use out of them just because they have to rely on software written by other people. So even if you don't want to become a software engineer though, learning how to program will allow you to turn into a much more useful "swiss army knife" that can do anything that you need it to.

13:38 There is a lot of people out there like that, you know if you are a lawyer, if you are a doctor and you run a small practice, there are all sorts of things behind the scenes that have nothing to do with lawyers and have nothing to do being doctors but they have to sort of manually go through all this business and data stuff. And that would be ideal for what you are proposing, right?

13:57 Exactly, yeah. It's pretty good when I describe what the programming book is about, and it's like, "Oh well it's programming little scripts to automate tests for people who don't want to really become software engineers they just want to automate things", and a lot of people tell me like, "Oh yeah, that actually sounds like a great idea". So it was really helpful to sort of nine months into writing this, and I have no idea if the world needs yet another programming book or something like that.

14:23 But it's worked out pretty well just because I think a lot of people recognize that that large software companies aren't going to write software that does their particular tasks, because they have such a specific workflow that's specific to their own practice or their own organization. But they would just need a 20 lines script to do something and they don't even know what it has to do until it is suddenly there, faced with this task. So just if they had those programming skills themselves, they could work it out themselves.

14:57 Right, I mean, otherwise they are probably paying thousands of dollars and hiring a consulting company, or they are going to somebody like Elance and they like have no idea what are they getting and maybe it is more likely they are just not getting it done, right?

15:12 Oh yeah. And once you are going to spending that large amount of money you sort of want a large application, when even that's not necessarily what you really need.

15:22 Yeah. That's right. So you really stuck through to your original vision for the book in terms of how you chose topics and how you presented them, and how you taught Python. So you threw away a lot of the traditional OO design pattern fancy style of programming and you said, "well if you are only writing a 100 lines of code, what do you really need?" Yeah?

[music]

This episode is brought to you by Hired. Hired is a two-sided, curated marketplace that connects the world's knowledge workers to the best opportunities.

Each offer you receive has salary and equity presented right up front and you can view the offers to accept or reject them before you even talk to the company.Typicaly candidates receive 5 or more offers in just the first week and there are no obligations ever.

Sounds awesome, doesn't it? Well did I mention the signing bonus? Everyone who accepts a job from Hired gets a $2,000 signing bonus. And, as Talk Python listeners, it get's way sweeter! Use the link hired.com/talkpythontome and Hired will double the signing bonus to $4,000!

Opportunity is knocking, visit hired.com/talkpythontome and answer the call.

[music]

16:56 Oh yes, exactly, like for example I don't go into object oriented programming at all, I think I might briefly mention it at some point in the book, but I don't talk about classes or anything. I skip list comprehensions and a whole bunch of other Python nifty little features, just because you really don't even need that. I think somewhere in the first chapter I say something like, "Using global variables is kind of bad once your programs get big, but go ahead and do it you are not going to be hurting anything" Just to keep things really simple.

17:33 Yeah, that makes sense. By the time you understand why this is a problem you know how to fix it, you are going to be doing something different anyway, right, you may never reach that point, so why impose all this structure. I mean that's kind of why Python and starting with Python is cool, is you can start easy but scale up like, I am saying to these high end large scale web apps, right, so you should be maybe take that same approach from how do you write code perspective as well.

17:57 Right. And I was just always sort of suspicious whenever I started learning a new language or something like that, you know, I would go to a library or bookstore and try to find whatever books and I would notice like well there is 600, 700 page books on C++, do I actually need to know all of this right from the start in order to start writing code in this? So I really wanted something that just kept to the basic minimum.

18:24 Yeah, what's crazy about that C++ book is it was probably just a language you still couldn't create a webpage, you couldn't talk to a database, you couldn't show UI, nothing.

18:33 Yeah, exactly, it was just a lot of syntax and maybe the reference material for the standard library and...

18:41 Yeah, but let me tell you, you could sure create your own operator of the load at the end of that. But still, no window.

18:47 Yeah, you'd have no idea why you'd want to make that.

18:50 Yeah, exactly.

18:52 So I mean a lot of those books are made for software engineers who already know how to program and sort of know all of these concepts already.

19:02 Yeah. So one thing I thought was cool about your book is you are using Python 3-

19:07 Yes. Yeah, I made the switch to Python 3, I think about 4 or 5 years ago. Wow yeah, Python 3 has been out that long.

19:18 It has.

19:21 Yeah, originally the first book I wrote was using Python 2 and somebody recommended hey why don't you make it for Python 3, and I thought oh yes, that's one of the simple and obvious things. So I've been working a lot with Python 3. At my last sort of day job we were still using 2.6, I think and that's just because we had a large existing code base and I didn't realize how many people were still in that same boat until I was at PyCon recently, in April this year in Montreal, and I think during the keynote the speaker asked the entire room of several hundred people how many people are on Python 2 and how many people are on Python 3, just to show hands.

20:02 And it looked about 80% of people were just still using Python 2.7, and just like tiny minority of the room was on Python 3 which was sort of astounding for me. So, I'm very specific and in particular about telling people if you are going to start a new project, or you just learned how to code, go with Python 3. I mean, at this point, a lot of major modules now have Python 3 support so the old excuses of like, "Well, if you want to learn how to use such and such library then you are just going to have to use Python 2- anyways you might as well start with that" so I completely recommend people starting in programming to learn Python 3.

20:47 Yeah, that's awesome. And I totally agree with you, you know I put together my website for the podcast using Pyramid and SQLAlchemy and various other packages all Python 3, no harm, but I understand if you've got a million lines of Python 2 code you might not want to go mess up that. So, it depends whether you are new, whether the project is new, there is a lot of variables there.

21:07 Yeah.

21:08 Yeah, but I think it's cool that you are just at least starting people off down that path as the default and maybe they've got to change for some reason. Kenneth Reitz was talking about interesting data point the Django guys they traditionally had their documentation in Python 2 and they switched it to Python 3, just by switching the documentation's default view to Python 3, it like increased the usage or something like by 4 % of Python 3, it was like wow. Maybe it was only for Django, or it was for- I think it was for Python more general I would have to look at the graphs again, but it was pretty crazy.

21:46 Yeah. A tiny push in this direction, and I think that's a lot of things is that Python 3 isn't= I mean it has a lot of new and great stuff in it but it isn't so completely new that it has a lot of killer features where people are thinking, "we must go to Python 3". A lot of the times people say, "well Python 2 is what we know so we'll just go ahead and stick with that". So I think it just needs to get that initial inertia going.

22:14 Yeah, I'd love to see some killer feature coming to Python 3 only, and really encourage people to switch but like you said, I don't think we are there yet.

So one thing you do in the book that I thought was really interesting and I think most programming books would absolutely skip but makes such perfect sense for the audience and experience level that you are targeting, is you actually teach people how to use Google and StackOverflow to get programming answers.

22:40 Yeah, that came from- I put my email address in my first book and I said, "hey, you should just go ahead and email me if you have questions", and so I would get emails from people and I remember going up I had like rtfm shouted at me on IRC channel all the time and I was thinking like, "oh that's really obnoxious and annoying".

23:02 But I could see the intent behind that was to make people more self sufficient, so I would get a lot of questions where people would say like "how do I do this", and I thought like "oh use the terms that you can Google, and so at the very beginning of the book I sort of wanted to help people say like, Ok, so programming might be hard at times but you can always just google for- if you get some error message which will never make sense whatsoever, like the common example I use is if you forget to put the ending quote on the string the error message isn't "you forgot to put a quote to end a string", it's something like "ioooo syntax error unterminated string" or something like that and you have no idea like even if you are a native English speaker you have no idea what that means.

23:50 So, I just wanted to say, "Look, it's ok, you can just copy and paste that entire message into Google and you'll find a bunch of websites where people have had this exact same problem", the top 3 results will probably be StackOverflow and then they can just learn of like oh there is a site StackOverflow and I can ask questions there. Especially because after a while I notice people would be email me the same questions so I thought "oh well, it's not very efficient for me to individually sent out this answer each time". So making people more self sufficient in finding answers for themselves I thought was something I wanted to have right at the start of the book.

24:28 Yeah, that's really cool. And, as programmers we know, that you can put insane stuff and search for it but when you are learning, you don't necessarily know you can just put like an error code or other bizarre stuff in the Google and get insanely detailed answers.

24:44 Yeah.

24:45 One time I had a friend who had Outlook like small business edition match for some weird thing on Windows and it like went crazy and lost all of his emails. And he said, "I know you are not really into this, but I know you know computers well, could you just look at this and help me". I'm not an Outlook person, I don't really know but he came up and said you know, error ox... it had some huge long hexadecimal error code or something, so I just typed Outlook and that thing into Google and bam-there were the exact steps that fix the problem. And I was like "look, this is what you can do", and he was like "how is this even possible", right? It's just we take it for granted but I think it's cool that you show people how to do that. Because it's surprisingly effective.

25:27 Yeah I mean I had a friend she wasn't a programmer but she worked at biotech startup and she wasn't there in an IT role or anything like that but she effectively became this small company's IT department I think because she was the only person who wasn't afraid to just google how to do stuff, whereas everybody else was just amazed and thought she was really great at computers or something, and it's like no she can just sit down and she is not afraid to say, google for "sharepoint server setup". And then just follow all of the steps.

25:59 Yeah, that's awesome. There was some study done that said you know what is the most important personality trait for successful startup founders, and basically for people creating tech companies in particular. And it turned out the most important thing was simply persistence. Not being super smart-

26:18 Right, just having that tenacity-

26:20 Yeah, and this is probably- I'm just going to keep searching keep digging until I get there, and that's cool.

Another thing that you have in a lot of the sections is you've got like practice questions and you've got even challenges, so that's really nice to have some hands on component.

26:35 Yeah. I didn't have those in the first couple of books I wrote and I kept getting emails from people who said like, "oh it would be great if I had practice questions" I always thought that was something that you know was sort of just filler and nobody actually really follow through with those. I remember when I read programming books I would kind of you know answer a few of them maybe or sometimes just skip them. But a lot of people think like, "oh yeah, it would be great to have these practice questions", and also we get teachers and professors saying, "oh yeah, I love your book, it's great I'm using it for this course but there is no practice questions or any exam material or things like that. It would be great if the book had that".

27:15 So that really opened my eyes to just how many people could find this information useful. And also I wanted to sort of keep focus on having the source code do actual programs, and not just have this be a laundry list of programming concepts that I just- all of these are loops, these are variables, these are functions and have it as just that, I wanted to have actual complete programs as well that people could see-

27:45 Yeah, that's great. Do you have your finished examples and programs on something like GitHub?

27:50 They're on the nostarch.com/autometestuff website, there's a link there that says like here is the zip file for all the programs and things.

28:00 That's cool, so people can go and download them.

28:02 Yeah.

28:03 Yeah, nice.

So we talked a little bit about why you chose Python over other languages. But there is certainly, it seems like there might be some tradeoffs like suppose you wanted to do that work with excel, I know if maybe you chose something like .Net you could use like the com integration on Windows to directly integrate with excel, and stuff like that, you know, what was your thought process of choosing Python over the other various things?

28:31 To be honest I really didn't spend that much time thinking about it, mostly because Python was such an obvious first language to learn, it has such a great learning curve, that I thought "well everything I can just kind of figure out after that", because I didn't want to choose, go with a different language just because it would make some other things easier. I thought, "well Python's great, it's mostly the same if you have Windows or Mac"-

29:04 Yeah, the cross platform part of it is really nice. So...

29:06 Yeah, and it turns out there is plenty of modules for doing things like working with excel spreadsheets and reading word documents-

29:14 Yeah that was actually a little surprise, because I've never tried to work with excel from Python, but it sounds pretty easy, maybe you can talk a little bit about the second half, or second segment of your book, so the first half is all about here is how you can start programming, here is like loops, in a really approachable way, but then you get into like let's automate some things, can you talk about some of the things?

[music]

This episode is brought to you by Codeship. Codeship has launched organizations, create teams, set permissions for specific team members and improve collaboration in your continuous delivery workflow. Maintains centralized control over your organization's projects and teams with Codeship's new organizations plan.

And, as Talk Python listeners you can save 20% off any premium plan for the next 3 months. Just use the code TALKPYTHON.

Check them out at codeship.com and tell them thanks for supporting the show on Twitter where they are at @codeship.

[music]

30:24 Yeah, I mean I wanted the book to be for complete beginners, so I have that first part of the book which is assuming you don't know anything about programming whatsoever, but I thought well it would be nice to actually have like in the second part going to all these different third party modules that make doing all these different tasks easier. So there is a chapter on web scraping, using Selenium and Beautiful Soup, and Request and then also another chapter on using Openpyxl to work with excel spreadsheets, and things like that.

30:56 I was really surprised at how many modules were out there, that were actually high quality and projects that I hadn't really heard of before until I started looking for them. And so, a lot of the initial work of writing out this book was just going through and mapping out ok where are the problems that have to be solved, what modules are available out there and Python is pretty well supported in that regard.

31:20 Yeah, I think you are right, I think the whole PyPi package stuff- there's 56, 57 thousand of those, right? A lot of them. It's great. There was the whole XKCD cartoon about Python, you can just type import antigravity and that kind of sums it up, right?

31:42 Yeah, there is the concept in Python documentation of Guido's time machine, where Guido Van Rossum, the creator of Python would commonly reply to emails when people said like "I'd really need a module to do such and such" and he would reply like, "Oh yeah I just committed the module that did that last night" leading a lot of people to think he actually has a time machine and can start writing this code before even think of it.

32:08 Yeah, that's awesome. You've got this book, you've two other books, you also said you've done a couple of open source projects, packages for Python. Do you want to speak about that a little?

32:18 Yeah. What became the most popular of them so far, is the one that I actually wrote for the book. It was for chapter 18 on controlling the keyboard and mouse- I found a lot of code out there that well I wanted a module that first worked on Python 2 and 3 and also worked equally well on Windows, Mac and Linux, and so I would find a lot of great modules except you know, some of them would only give you for Python 2 or some of them would only be for particular operating system, and or sometimes the API was just had a bunch of odd names for things so I wanted to be really simple.

32:54 So I created Py auto GUI, which gets a few thousand downloads each month now and especially now that the book is out and covers it, but it was basically just taking all the best parts of code from all these various modules and putting them into this unified interface. And it's really simple, you just import the module and it has a click function or a type/write function to just type out an entire string, or if you are going to press down certain keys so these are all just single functions.

33:26 So I really like that. Before I had started writing this automate book, my second book was on Pygame, and so I had written a few modules for that one which was Pygcurse, which is sort of a curses emulator except built on top of Pygame. And that was so that I could have some way of writing text to certain cell like I could tell the cursor to go to some XY position and then start typing out things like that. Just because, again, you know, Python has curses, but then for Windows there is a separate console module that you would have to install so there is no unified thing that just works on all operating systems and then also there is Pyganim which is a sprayed animation module that I made for Pygame.

34:18 Nice, for billion like 2D little sites color apps, to that kind of thing?

34:22 Yeah, well it's basically it's just to be able to take like an inanimate gif and put it into your programme. I mean PyGame is great because it would make it really easy to just display an image in a window somewhere, but if you wanted to have you know, little like animation of like a running character or something like that, it would have to program all that logic in yourself, because Pygame was fairly bare bones. And I looked around and I saw that nobody else had made something like this in particular for Pygame, so I just started that as like a week-long project. And I've written a few other modules but you know, they are all just really tiny and just have like a hundred downloads a month on PyPi. But yeah, it's just a lot of really simple things.

35:04 Yeah, that's really great. All right. Al I think this might be a good place to wrap it up. But before I let you go, let me ask you a few questions that I typically ask people on the way out- in addition to Py Auto GUI, what other PyPi packages are your favorite, and most useful, or you think people maybe don't know about, you should tell them about.

35:24 Oh, I think really at the top of that is Selenium, the web scraping chapter on the book's website, I the web scraping chapter is the most popular one. And so Selenium basically launches Firefox or different browser and lets you programmatically control it, so you could just automate doing web scraping or filling out forms or anything like that, and I'd heard of Selenium and other things before but I always thought like, it must be this really complicated thing that you have to spend an entire weekend reading up on, I did realize it was about four or five different functions that you have to learn and then you can pretty much you are set after that. So, Selenium is definitely one of my- I'm completely amazed at how much you can do with it even with very little knowledge and very little time learning about it.

36:21 Yeah, that is awesome. It seems like you almost do like basic load testing, integration testing, other types of sort of web automation with it, right?

36:30 Oh yeah, exactly, I mean, because it's actually launching a web browser, you can have it work with whatever browser plugins you have, or it'll run Javascript on the page so you know, it's not just downloading files from a URL, you can actually simulate the Javascript as well and then see how it looks like for the user, it's a really great module.

36:54 Yeah, that's excellent. Make all those client sides apps actually show what they are supposed to show right?

37:02 Yeah.

37:03 Nice. Ok, next one, what kind of editor are you using these days?

37:09 I really like Sublime text, for the longest time I used this one text editor called edit text, which was sort of like Notepad++ , well there is actually an editor called Notepad ++, but it was all of the things, I'm on Windows, it was all the things that notepad.exe except it had a lot of other nice features but it was still fairly light weight. I've never actually gotten around to learning Vim or Emacs to any great extent where I can sit down and use them but I think I like using the mouse too much.

37:45 Yeah. I hear you. Ok, cool, I like Sublime as well, it's really nice

37:51 Yeah, and in the book I just say go ahead and use Idle because it's just comes with Python, if you are on Windows and so you don't have to do any setup of configuration which is really nice.

38:01 Yeah, that is great and it is all about reducing the friction and getting people to like have those moments of hey I've created something rather than why do I care how to declare a string.

38:11 Yeah, exactly.

38:12 That's awesome. Ok, so what do you want to do a final shout out to, let everybody know about? Your book obviously.

38:17 Oh yes, definitely the book. It's released under the Creative Common's license, so you can actually read it online, at autometetheboringstuff.com. But also I'd like to just encourage people to go ahead and make it out to PyCon it's a really great conference, you don't have to be a heavy technical person to get a lot of benefit out of and the people and the community are really wonderful.

38:44 Yeah, that's awesome. I would like to second that as well and this year it's in Portland Oregon which is my hometown so that's pretty awesome. And I'm trying to get together a some kind of session that's like a panel discussion live podcast presentation, so maybe I'll build the pool it off, that'll be fun.

38:59 Oh yeah, that sounds great.

39:01 Yeah, people should definitely come to it, it'll be great. And then I also want to encourage people go check out your book and maybe even buy it right, you've done some really cool stuff in, it is available sort of separate pages as html and you can check it out but you know, it's not that much and support the work.

39:20 Yeah, a lot of the people really like having it all combined on their kindle or just having the physical book in their hands.

39:26 Right, absolutely.

All right Al, thanks for being on the show, it's been fun.

39:31 Oh yeah thanks, it's been a lot of fun for me too.

39:32 Yeah, bye.

Today's guest was Al Sweigart, and this episode has been sponsored by Hired and Codeship. Thank you guys for supporting the show.

HIred wants you to find your next big thing- visit hired.com/talkpythontome and get 5 or more offers with salary inequity presented right upfront and a special listeners signing bonus of $4000.

Codeship wants you to always keep shipping- check them out at Codeship.com and thank them on Twitter via @codeship. And don't forget the discount code for listeners, it's easy TALKPYTHON.

You can find the links from the show at talkpythontome.com/episodes/show/19.

Be sure to subscribe to the show. Open your favorite podcatcher and search for Python. We should be right at the top. You can also find the iTunes and direct RSS feeds in the footer on the website.

Our theme music is Developers Developers Developers by Cory Smith, who goes by Smixx. You can hear the entire song on our website.

This is your host, Michael Kennedy. Thanks for listening!

Smixx, take us out of here.

[music]

Back to show page