Learn Python with Talk Python's 270 hours of courses

#106: Invent your own computer games with Python Transcript

Recorded on Thursday, Mar 23, 2017.

00:00 Al Swiger is back on Talk Python. This time we're inventing our own computer games.

00:05 Has anyone ever asked you for a resource to get started on how to learn programming or

00:09 how to learn Python? Well, one excellent and fun option is Al's book, just updated,

00:15 called Invent Your Own Computer Games with Python. And we'll be digging into it this episode.

00:20 It's Talk Python to Me, episode 106, recorded March 20th, 2017.

00:26 Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries that

00:56 ecosystem, and the personalities. This is your host, Michael Kennedy. Follow me on Twitter,

01:00 where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm,

01:05 and follow the show on Twitter via at Talk Python. This episode is brought to you by Intel and Get

01:12 Stream. Be sure to check out what they're offering during each of their segments. It helps support the

01:16 show. Hey, everyone. Before we get to Al, I want to share three pieces of news with you.

01:21 First two, I've launched two new courses this week. The first one, I partnered with Dan Bader,

01:27 and it's called Managing Python Dependencies. This is a deep dive into how you need to manage your

01:34 dependencies in Python, understanding pip, understanding requirements, and actually figure

01:40 out what makes a good dependency in the first place. How do you search through all the possible

01:45 packages on PyPI and other locations and determine which dependency you should even take? You'll learn

01:51 all of that and more. You'll go from basically writing scripts and little utilities to building

01:56 proper applications by mastering dependency management. Another new course that I wrote is

02:02 Using and Mastering Cookie Cutter. If you want to help users fall into the pit of success when they get

02:09 started with your project or your library, having a cookie cutter template that sets everything up just

02:14 right for them is a really good option. So if you want to learn about cookie cutter, how to consume

02:20 it as a user, how to create cookie cutter templates as maybe a project lead or something like that,

02:25 and even modify and contribute back or just customize for your own purposes, the cookie cutter project,

02:31 then you should check out Using and Mastering Cookie Cutter.

02:34 And the final piece of news is we're now offering course bundles. If you come to training.talkpython.fm,

02:40 you can buy an entire year's worth of content. So make this year the year you grow as a developer and get a year's worth of Python training guaranteed. Now let's talk to Al and check in on his cat.

02:53 Al, welcome to Talk Python.

02:55 Oh, it's great to be here.

02:56 Yeah, it's great to have you back. It has been a long time since we talked about your huge cat.

03:00 Oh, yeah. Yes, she is slightly less huge these days. I put her on a diet.

03:05 Your cat's on a diet. How awesome.

03:07 Yeah, she's, well, still kind of a bowling ball, but yeah, she's doing great.

03:14 I know you were on show, I think it was show 19. I'm just doing that from memory, but certainly around that era. But I suspect many people listening now don't remember the story. So maybe let's talk about how you got into programming and how you got into Python and just start from there.

03:29 Well, yeah, I always say that I hate telling people how I got started into programming because I was one of those kids that learned how to program in about the third or fourth grade, just programming in basic, making little computer games.

03:42 And I hate telling people this because it sort of reinforces that idea that unless you were programming, you know, from when you were a toddler or something like that, that you'll never catch up and there's too much to learn and you're too old to start learning to program, which is really nonsense.

03:57 Yeah, I think everything that I learned about coding from like third grade up to graduating high school when I was like one of those computer kids. I'm pretty sure anybody with, you know, the internet and Google and Stack Overflow can learn everything I learned in like maybe a dozen weekends.

04:14 Yeah, maybe just YouTube alone would take care of it.

04:16 Yeah, yeah. I mean, learning to program is so much easier today than it was 10 years, 20 years ago. Whenever I say like, oh, I've been programming since I was in the third grade, that's fairly meaningless these days. And so, yeah, I don't want to discourage anybody from learning that. And also whenever anybody says, I've been programming since I was, you know, 10 years old or something like that, I keep thinking, well, yeah, but it was probably pretty lousy programs that you were making.

04:42 It's true.

04:43 Just like I was.

04:43 Yeah, you know, what's really interesting about when you stayed experience in those terms is you could have been working for two years, but on like a massive wide range of technologies and really throwing yourself into it.

04:57 Or you could have been programming for 20 years, writing basically the same code. And I would put my bet on that two year person being able to do more in the industry, having that experience. And if you just keep doing the same thing.

05:08 So there's quite a lens you have to put on. Like I've been doing it for 20 years or 10 years or whatever, right?

05:14 Yes, definitely. And the one constant in this industry is that you're always going to have to be learning new things pretty much nonstop. So the feeling that you're really dumb and you know nothing is never going to really go away. So just get used to it.

05:28 Yeah, that was my Saturday morning. Saturday afternoon, I felt a little bit better about life. But Saturday morning, I was like, Oh, gosh, really? Why can't I make this work? This is killing me.

05:38 So yeah, it's a never ending thing, which I think is what's wonderful about the programming industry. But if that's not your thing, then you're not going to love it, are you?

05:46 Yeah, I mean, certainly a lot of wheels get reinvented. But I think that there is measurable progress being made. I mean, you can just do so much more with software libraries and tools today. And yeah, so I very much encourage people to continue to or just pick up learning how to program. Or maybe if you tried picking it up like a decade ago, and you thought it wasn't for you, just give it another shot.

06:10 Yeah, absolutely. You know, one of the things I think is interesting is you talked about how the tools weren't really that great to write software when you got started. And I suspect I'm just assuming but the scope of the things that you created was pretty narrowly focused, right? You weren't like creating YouTube, or Dropbox, or something like that, right?

06:29 Right.

06:30 I mean, it feels like on one hand, the programming tools and languages have got so much better. And yet there's more programmers, and we still work hard. Like, why do you think that is?

06:40 Well, I think it's just the scope of things that we build are so much greater. This for the last couple of weeks, I've been learning bootstrap. And this is a JavaScript and CSS framework for basically creating modern looking websites. You know how websites usually have like the giant image on their front page.

06:58 Yeah, and then they have like another row with like three little images in a row. And then they have like another row. And you can sort of tell like, oh, this is sort of a website created with bootstrap. But the reason that all these websites look that way is because bootstrap makes it really easy to make this reactive website that looks great on your desktop, but also great on your mobile phone.

07:18 And it's doing a lot of busy work behind the scenes to make that happen. But using bootstrap on the other hand, is really I mean, I'm really impressed by how by how simple and easy it is to pick it to pick up and start using. And meanwhile, it's doing something that if I were to try to do it on my own would just be weeks and weeks and weeks per web page or per site or anything like that.

07:43 You'd have to learn about reset CSS is about media queries, about poly fills for different. It's just like, oh, like all that stuff is gone, right? So now we can focus on building something.

07:53 The design is kind of solved a little bit. I mean, it's still a challenge. But right. So we would look beyond those problems and say, okay, now what is the actual problem we're trying to solve? Right? And I totally agree that this is.

08:05 There's in my opinion, there's no danger that we are going immediately out of a job.

08:09 Oh, definitely. I remember, like, I think sometime in the early 2000s, I was in a coffee shop and I was overhearing somebody talking with some software developer and they asked him, like, I don't know, like, do we need more software? Like, when do we like, will we always need more software? And I kind of thought it's sort of like, well, I don't know.

08:29 Will we need more novels? Or will we need like more movies? Or, you know, it's like, oh, we already have this detective story. I think that entire genre has been filled by this one book.

08:39 So yeah, I mean, in a sense, you know, we're always going to be creating new word processing applications or new instant messaging applications.

08:47 But there's a lot of stuff. And I think we just sort of take it for granted and forget that it's there in the same way that fish just forget that water is wet because we get so used to it.

08:57 But I mean, like, all these modules like jQuery is what made JavaScript programming so much easier. And even things like Python is just making programming in general so much easier compared to working with C++ or older languages.

09:11 A lot of busy work that you would have to do as a programmer writing code in assembly is just taken care of for you so you can concentrate on what makes your application different.

09:22 Yeah, come to think of it, I haven't allocated or deleted any memory in quite a while.

09:25 Awesome. So people may remember from episode 19. I'm pretty sure that's right. But why don't you tell everyone what you do day to day these days? Like, what do you do for a job in addition to writing books about inventing games?

09:39 So I wrote those books and then started self publishing them while I had a full time job as a software developer. And about three years ago, yeah, I think it was 2004 was when I took the plunge and I was in the middle of writing automate the boring stuff.

09:55 And I was fairly certain that I was going to be past deadline on that. And I was just everything was was working out well for me at that point where I thought like, okay, I can leave this job and continue writing full time.

10:08 And I think automate like, you know, came out later that year or sometime 2005, I believe. But yeah, it worked out that I could finish this book. And if it was really successful, maybe I could continue writing more books. And if it wasn't, then I was in a position where, you know, just being in San Francisco as a software developer, it wouldn't be that difficult for me to get a new job. I'm always blown away by how successful automate the boring stuff has been.

10:35 Yeah, that's a great book. And that was the topic of our first episode that we did together. Somebody recommended I reach out to you because they thought your book was so cool. And so maybe tell people, you know, what's the elevator pitch on automate the boring stuff?

10:47 So automate the boring stuff is a book that teaches non programmers and office workers how to code and also how to do really practical tasks. So the one story that I think of is I had a friend who worked in an office and part of his job was

11:04 just opening up PDF files and then finding this one line in each of these PDF reports and copying and pasting it to an Excel spreadsheet and then just opening the next PDF and just doing this for four or five hours at a time.

11:17 And it's something that he taught himself a little bit of Python coding and grabbed a whole bunch of modules like he doesn't know the PDF file format, which is insanely complex, but he can learn how to use this PDF module for Python to grab this text and then update an Excel spreadsheet.

11:34 And it took several hours to write this, but running it now, you know, it takes a few seconds to do all that work that normally would take him hours and hours.

11:45 And I realized that, you know, a lot of people were saying, oh, everyone should learn how to code.

11:48 And I sort of thought, well, what exactly could you do if you weren't a software engineer, but, you know, you do work with a computer every day.

11:56 What are the things that you would want to do to using programming to help just free yourself from a lot of tedious tasks?

12:04 And so that's sort of the first half of automate the boring stuff with Python is a general Python and programming tutorial for complete beginners.

12:11 And the second half just covers a whole bunch of useful modules that the Python community has created.

12:16 Right. And just little tasks that you could automate in your life that, you know, maybe you have somehow, right?

12:21 Yeah. Oh, yeah. Yeah.

12:22 Nice. So I think that's a great idea.

12:24 And when I hear people say that we need to teach everyone to code or coding is a core skill like math and reading.

12:31 I do feel that that's true, but I don't feel like we need 10 times the programmers.

12:37 I feel like instead, like having some sort of programming skill amplifies whatever you actually are good at.

12:44 Right. So if you're if you're a biologist, you're going to be a really effective biologist if you can automate things.

12:51 Right. If you can use a little Python to like not do stuff by hand and collect a bunch of data and whatnot.

12:57 Same for finance, same for whatever. Right.

12:59 Oh, yeah. And today, most people who want to gain more technical skills are pretty much doing programming, except they're doing it with Excel.

13:07 Essentially, just like creating really complicated spreadsheets to manage large amounts of data and then using these complex formulas.

13:14 And, you know, that's a great thing.

13:16 And but also a terrible thing because, oh, my God, that code.

13:18 But, you know, actually sitting down to learn a programming language like Python makes, you know, doing these tasks so much easier for them and also, you know, produces very readable code.

13:28 And it's possible to share this these small scripts with other people.

13:33 And also, I guess the same is done with Outlook mail rules.

13:37 Like I remember at my at the last job I had, you know, I would get about 150 or 200 automated emails for different things every day.

13:45 And it would be completely unmanageable, except I just set up, you know, a dozen or so Outlook rules where, you know, if I get an email from this email address with this in the title, like search for this substring, filter it to this folder and just doing that over and over again.

14:01 Well, I mean, that's essentially the nature of programming.

14:04 You're trying to program this logical intelligence to do all this tedious work for you.

14:10 Yeah, I think that's a great example for people who are getting started.

14:13 Right.

14:13 I think I have a ton of Gmail rules as well.

14:16 Very nice.

14:17 So maybe we should start by getting start getting into your book.

14:21 So you have a number of books and one of them you just released the fourth edition and it's called Invent Your Own Computer Games with Python.

14:29 Right.

14:30 Yes.

14:31 Yeah, it has an absurdly long title, but it was the first book that I ever wrote.

14:37 And I put book in quotes because it was sort of just a series of web pages that I had.

14:44 And I just started putting chapter numbers on them eventually and then created a self-published book for it.

14:50 So I thought like, I don't know, it's sort of like Invent Your Own Computer Games with Python.

14:53 And I didn't realize like, you know, I was like, oh, if I'm going to make this a commercial book, maybe I should come up with a snappier title.

15:00 But it became popular.

15:01 And so that was sort of the title I was stuck with.

15:04 No, I think it's a good title.

15:05 It's pretty descriptive.

15:06 It's not too long.

15:08 So I know not everybody gets into programming because they want to create computer games.

15:13 Like I don't feel like I personally got into programming to create computer games.

15:17 I was, I came more, I think I came at it a little bit later.

15:20 So I came at it from a, hey, I have these research problems in my PhD program I got to work on.

15:25 So let's try to solve those or even in undergrad.

15:28 But a lot of people do want to build games, especially younger people.

15:33 Right.

15:33 And so, so what's the audience look like for your, your book?

15:38 The current audience, it's actually quite a wide range of readers, but the intended audience is roughly maybe as young as nine years old.

15:46 But sort of, I always pictured invent your own computer games with Python as the book that I wish I had read or I had when I was young.

15:56 Because I remember there was like only very few books on programming in BASIC that I had access to.

16:01 And there were so many different versions of BASIC that, you know, some of the programs didn't work and I really didn't have, there was no real internet to Google for answers.

16:10 So I wanted to just get a broad range of different types of games.

16:15 And so that's why the, the book ended up with over 20 chapters of, of games in it.

16:20 Yeah.

16:21 I think that's really cool.

16:22 Yeah, it was just, I wanted a book that went from knowing absolutely nothing to being able to make some like really like clever little games that wouldn't take up that much time.

16:31 You know, it wouldn't take like a week to write.

16:33 Games are a great sort of gateway into the world of programming.

16:37 Like I, I really didn't have that many ambitions of becoming a professional game developer, but learning how to program games just because I was really into Nintendo as a kid became this, it was the main motivating force for me to get into programming.

16:51 And then later on become a software developer.

16:53 Yeah, it's cool.

16:54 And each little chapter is pretty small and everyone has a different game or most of them have different games where there's kind of a quick win.

17:03 And I think when you're learning programming, that's so important because you can spend all your time going, here's how you declare variables.

17:10 This is what a type is.

17:11 This thing is an integer.

17:12 That thing is a string.

17:13 This is a loop.

17:14 This is the function use the def word, but you think it's like, oh my gosh, like why do I care about this anymore?

17:18 I thought this would be fun and it's not fun anymore.

17:20 Right.

17:21 So how do you solve that?

17:23 Do you think, like, how did you address that at least in your, your book?

17:25 So in my book, and I really am copying what a lot of like bite magazine from the eighties, which would have just listings of source codes of source code for a small game.

17:36 That you would just copy from the magazine.

17:38 There were also a lot of.

17:39 Maybe even type it in, right?

17:40 Yeah, yeah, exactly.

17:41 And I believe, Atari archive.net or Atari, Atari archive.com is a website that has a lot of these old basic programming books that you can view online now.

17:53 And I thought it was just great because none of the programming books that taught me like, these are variables, these are loops and everything.

18:00 Like I had the reference manual, but that didn't show me anything.

18:03 I couldn't make heads or tails of it.

18:05 But I found one book that basically taught by showing the complete source code to a small game and then just sort of explaining how it works.

18:13 And as I was writing, invent your own computer games, I realized with Python, if anything, this is way easier than with basic because the code is much more direct and much more simple than having to, you know, sort of, there's still a lot of hoops that you would have to jump through through basic, even though basic was revolutionary for its time as being a simple programming language.

18:32 Right.

18:33 Still, it didn't have much of a base library that you could leverage.

18:36 There's a lot of stuff you had to do yourself, right?

18:39 Yeah.

18:39 Nice.

18:40 So you start out in this thing by explaining a couple of pieces, like what is the REPL?

18:46 What is the interactive shell?

18:48 How do you write programs?

18:50 What is a variable?

18:51 It's interesting.

18:52 When I started doing training for software developers, I always, my first concern was I'd end up in a classroom of super smart people and they would ask me all these hard questions and I would not know the answer.

19:04 And I would look stupid or they would feel like they didn't get their money's worth or whatever.

19:09 What I found was those people are super easy to talk to because you are speaking the same language.

19:17 But when you are speaking to somebody who's just getting into programming, like many of the people reading a book, that is a much harder conversation in my mind.

19:26 And I think you did a pretty good job.

19:27 But like even talking about what is a variable and how does code execute?

19:32 I think it's easy to just go, well, it just does.

19:35 You just run it or whatever.

19:37 Right.

19:37 Like, like, was it easy for you to explain that stuff in a way that you felt conveyed it to newcomers?

19:43 I mean, I think my main approach to that was just for, I would write out sort of a map of all the topics that I wanted to cover and then just start drawing lines between them saying, like, in order to understand this, they have to understand this other concept and in order to understand that.

19:58 So I would sort of get this dependency graph of concepts.

20:01 And a lot of times I really am just sort of tempted to just say, like, well, it just works like this.

20:07 But the great thing about Python's interactive shell with the REPL is you kind of can get away with saying, well, this is just how it works by showing an example in the interactive shell.

20:17 Like, oh, type this in and then it spits this out.

20:19 And it's surprising how just having this sort of visible example that they can see and then you can show, like, oh, you can type, like, 2 plus 2.

20:28 And then you can also type 2 plus 2 plus 2 and then just sort of explain that, like, well, 2 is just a value.

20:34 Like, this is kind of like math problems in your math class, except if you think of these numbers as values and those plus signs as operators, you can see that this is an expression which just combines those and evaluates them down to, like, a single value like 6.

20:47 But I really lean heavily on the interactive shell for just demonstrating this because the last thing I want to do is just sort of talk about these concepts instead of actually showing, you know, what the computer does when you type in these instructions.

21:03 Yeah, that's the best way, right?

21:04 Is you have to just do the thing if you want to learn programming.

21:08 It's kind of unique in that sense.

21:10 I guess math.

21:12 If you're trying to learn advanced math, you can't just read a bunch of math and then, like, be able to solve problems.

21:16 You probably got to just do it as well.

21:17 But it's certainly one of the disciplines where you have to sit down and do the thing and experience.

21:24 So the REPL seems like a great way to do that.

21:26 Yeah, I mean, the great thing about computers is they do exactly what you tell them to, and that's also one of the worst things about them.

21:32 The most frustrating things ever.

21:34 It is much nicer to learn how to program, you know, with the computer right there in front of you telling you when you get things wrong as opposed to, I don't know, if you just checked out a calculus book from the library and tried to learn calculus.

21:45 I mean, you have this sort of inert book sitting in front of you, and maybe you're doing the math right, maybe not.

21:51 It's hard to tell because, you know, maybe you have just the answers in the back of the book for the questions in the math book, but you don't have, whereas the Python interactive shell, it'll always be able to tell you, like, oh, this evaluates to that or this raises such and such exception.

22:06 Yeah, exactly.

22:07 The only one that's hard to get it to give you an answer is infinite loop.

22:09 Oh, yeah.

22:10 Well, you know, you just have to wait a while.

22:12 Exactly.

22:13 I'm just going to wait for a little more time.

22:15 So one of the things that you used in the book was Idle, the graphical tool that comes with Python.

22:22 Why did you pick that over some other tool?

22:26 Like, I know the book was written a little while ago, so maybe those were some of the better UI tools, or what was the story there?

22:34 Oh, I wouldn't say that.

22:36 So Idle has, I would say, two things going for it.

22:39 I mean, it is sort of like a very rough IDE, and it's more text editor than IDE.

22:44 But the great thing about it is that it's really simple.

22:47 You can just fire it up, and it has the interactive shell in one window, and it has a file editor in another window.

22:54 And you can just press F5 to run your program, and it's really easy to get started with.

22:59 And then the second thing is also that it comes with Python.

23:02 There's nothing extra that you have to install.

23:05 You don't have to configure any environment variables.

23:08 You don't have to navigate your file system to find the, you know, Python.exe or the Python interpreter.

23:14 And this is actually a pretty big deal, especially if you've ever had to teach Python or teach programming in a classroom setting,

23:22 where now you have 15, 20 laptops that you have to set up, and maybe you don't have all the permissions

23:28 because the school district or the IT department decided to lock down all the permissions on things.

23:34 It just saved me a whole lot of steps where I wouldn't have to talk about, like, here's how to install Notepad++ if you're on Windows.

23:42 But if you're on Mac, then here's how to install PyCharm, and here's how to set it up, and all these other steps.

23:48 And I really feel like Idle is one of the reasons why Python...

23:53 I mean, there's lots of reasons why Python is so popular, but Idle is certainly one of them.

23:56 It makes Python a language that's easy to get started with.

24:01 And the more of that you have for any language, the more adoption you're going to see,

24:04 and the bigger of a community that you're going to create.

24:07 Yeah, I see.

24:08 So it's in your Start menu, it's in your Applications folder, or whatever, right?

24:13 And it's...

24:14 Once you run it, the path is there, right?

24:16 It's not like this environment variable is not set up, or whatever.

24:20 Okay, that's a pretty good reason, actually.

24:22 We all love Python for its tremendous productivity benefits, but getting the best performance takes some work.

24:42 What if you could get out-of-the-box, easy access to high-performance Python?

24:47 Intel Distribution for Python developers delivers just that.

24:50 Get close to 100 times better performance for certain functions when using NumPy, SciPy, Scikit-learn,

24:56 linked with optimized native libraries like Intel Math Kernel Library, access-efficient multithreading, and Python projects like Numba and Scithon.

25:04 Try the Intel Distribution for Python and experience performance today at talkpython.fm/intel.

25:10 And profile your Python and native C, C++ applications for performance hotspots with Intel VTune Amplifier.

25:18 With Intel, it's all about performance.

25:20 Do you think that Python would be better off if it had something like Swift Playgrounds?

25:33 Do you think that matters?

25:34 Oh, like what?

25:35 Like Swift Playgrounds.

25:37 Are you familiar with those?

25:37 Oh, no.

25:38 No, I'm not.

25:38 So, Swift Playgrounds, basically, it's kind of like a REPL, but on the right-hand side,

25:42 you can have, like, graphs and little animations.

25:46 Oh, okay.

25:47 And you've got the code, like, on the left and on the right, the output of that code going down together.

25:54 Interesting.

25:55 I think, like, IPython Notebook is sort of similar to that.

25:59 Like, it can have non-text output.

26:01 Yeah, IPython is the closest I can think to it.

26:03 But, you know, IPython is not something that's super easy for beginners to set up.

26:08 Like, tell somebody, like, you have Python, now get IPython running on Windows.

26:12 You know?

26:14 Right.

26:14 Yeah.

26:15 Well, the problem is I can't find vcvars.bat or whatever that thing is, right?

26:19 Oh, vcvars.bat.

26:21 Yeah.

26:22 Yeah.

26:22 You're like, oh, okay.

26:23 Forget it.

26:23 I don't know.

26:24 I'm just, I feel like there's Idle, and if, like, Idle was taken to the next level, it would look a lot like Swift Playgrounds.

26:30 And I'm wondering if something easy and built in there was really, really slick.

26:35 Whereas it feels like it's effective and it's nice, but it's not really slick these days.

26:39 Yeah.

26:40 Well, I mean, Idle is definitely sort of showing its age.

26:43 But in a certain sense, it is fairly timeless where it just has the, its simplicity means it can get away with just having the interactive shell and the file editor.

26:52 And it's perfect to work with.

26:54 It is also, I guess, somewhat controversial to just sort of add an application with your programming language.

27:01 But I'm really, or even something like a GUI toolkit like TKinter that was added to the Python standard library.

27:08 I don't really know of any other programming languages that sort of do that with their standard library.

27:13 But I'm certainly glad that that happened, that ended up happening.

27:17 Yeah, it was definitely nice for your game, right?

27:18 Yeah.

27:19 For your game book.

27:20 Oh, yeah, definitely.

27:21 Nice.

27:21 So you want to touch on some of the games that you take people through?

27:24 I mean, obviously, you have the requisite guess a number high-low game to start.

27:29 Yes.

27:30 I mean, that's, that's something that I've seen over and over and over again.

27:33 Even when I was back first writing this book, I felt like, okay, guess the number is perfect.

27:37 It has loops and if-else and variables.

27:40 And it's also just kind of like a fun little game where, you know, you can say like, oh, 10.

27:46 Well, my number is higher than that.

27:48 And so you can sort of do this dictionary style.

27:51 Yeah.

27:51 Binary search.

27:53 Sorry.

27:53 Yeah.

27:54 Yeah, exactly.

27:54 Yeah.

27:55 You're unwittingly, like the optimal strategy is the binary search for humans.

27:59 I do feel like that's one of the games that is like on a per line of code, like is the most dense in like fun and joy, right?

28:07 It's like what, like eight, nine lines of code probably.

28:10 Oh, yeah.

28:11 And people can actually get some anticipation and something out of it, which is pretty cool.

28:15 Yeah.

28:15 And so the book, that's the first program in the book and it continues on with, there's like a little joke telling program.

28:21 I mean, so there's not all the chapters have game programs.

28:24 Some of them are just sort of like fun little programs to run.

28:27 There's this joke telling program, which is really there just to get familiar with how to output text in certain ways and format the text.

28:35 And then next is a game called Dragon Realm, which sounds really fancy.

28:40 But actually, if anything, it's even simpler than the, I guess, the number game.

28:44 Is that like a mud?

28:45 Oh, well, I mean, it would look like it, but really it comes down to pick cave one or cave two.

28:51 And then it tells you if a dragon has eaten you or not.

28:54 Yeah, it's like one step in a mud.

28:58 Yeah, it's a coin flip, but it has like a really nice user experience tied around and story behind that.

29:04 Kind of like a lot of modern games where as long as you have a great story, we don't care if the game itself is kind of dull.

29:11 Yeah, exactly.

29:12 Exactly.

29:13 Yeah, I like the retro game experience where they specifically sort of water down the graphics and make it about the game experience and the story.

29:23 And it's kind of nice not to have like always the most shiny, shadowy, reflected on water graphic engine.

29:30 Right.

29:30 With nothing else to it, you know.

29:32 I definitely grew up with muds and sort of text adventures and that style of games.

29:38 And invent your own computer games with Python similarly has just text based programs for I think the first major chunk of the book in the last four chapters starts covering Pygame and 2D graphics.

29:50 But the great thing about having text only for just, you know, having keyboard input from the user and then all the output is just print statements is that you can always tell from the output that you get from the program where that came from in the source code.

30:05 So you can sort of like draw a line like, oh, okay, this text here that says the dragon ate me comes from this line, which is print the dragon ate you.

30:12 And so you can actually sort of see the flow control going through the program.

30:17 Whereas, you know, a lot of I don't know if you like fire up Unity 3D or something like that or just these really complicated game engines.

30:25 It's kind of hard to figure out what part of the code causes what to happen on the screen.

30:31 Oh, yeah.

30:31 Those 3D versions get so, so intense.

30:35 I remember I had done a 3D simulator in OpenGL and I couldn't see the thing that I was trying to display on the screen.

30:41 I'm like, I know it is in front of me.

30:43 Why can't I see it?

30:44 And I had like back face culling turned on and I had gotten clockwise versus counterclockwise backwards.

30:53 Oh, right.

30:53 So it thought I was inside the thing and it just took it.

30:55 I guess it was and it took me, I remember hours of like, why can't I see it?

31:00 And it should be counterclockwise, not clockwise.

31:02 It doesn't.

31:02 It only draws one side of the triangle that you're looking at.

31:05 So if you look at it from the other side, it disappears.

31:07 Exactly.

31:08 Why am I looking at the inside of this, not the outside of it?

31:11 Yeah.

31:11 So it certainly, I don't think that's a good place to start, even though like people, many people where I think, oh, I'm going to create Eve online.

31:17 I'm going to create some kind of unreal thing.

31:20 It's effective, but it's also not so, I don't know.

31:24 It's not as much fun as it sounds like in the end, in my estimation.

31:28 Yeah.

31:29 I mean, actually, so I'm working on a book right now for No Starch Press because I do some teaching classes with kids and they say like, I want to program Minecraft.

31:38 Minecraft is like the main game that I hear over and over again.

31:42 And I'm just like, oh, yeah, well, that's going to be a lot of work.

31:47 But the next book that I'm writing, which so far doesn't have a title, but I'm roughly calling it Programming Robots in Minecraft, is a book that covers this one mod for Minecraft called Computer Craft that adds in these programmable robots into the game world.

32:02 And so you can write these Lua scripts to program these robots.

32:06 And they're called turtles, just like the old logo turtles that do drawing on the screen.

32:11 So you can program these robots to just like move forward, move, you know, turn left, move forward again, start mining in front of you.

32:18 And you can basically have these robots sort of do all of your mining or chopping down trees or tending to a farm or building for you.

32:27 I jokingly call this book Automate the Minecraft Stuff with Lua.

32:32 And so I was hoping like to use this, getting kids who are really interested in Minecraft into programming, once again, using games as sort of a gateway into that.

32:43 The broader world.

32:43 Yeah, absolutely.

32:44 Yeah.

32:44 I'm just really sad that it's all in Lua instead of using Python.

32:49 But Lua is also.

32:50 Is there some sort of, yeah, is there some sort of Python adapter you could do?

32:53 There is a Python module.

32:56 In fact, I think NoStarchPress has a book called Learn to Program with Minecraft that uses a Python module for Minecraft.

33:04 It's more like a sort of a 3D editor.

33:07 Right.

33:08 Using in the Minecraft world.

33:09 So you can specify like XYZ coordinates and then change that block to something else.

33:13 But it's great because now you can just sort of instantly build giant creations by writing code.

33:20 Sort of like, you know, computer generated art.

33:22 Yeah.

33:22 You have these computer generated blocks now.

33:24 Okay.

33:25 Very cool.

33:26 Have you seen the movie Indie Game?

33:28 I-N-D-I-E?

33:30 Indie Game?

33:31 No, I haven't.

33:32 And there's Indie Game and then there's like a sequel.

33:34 And I think it's on Netflix and other places.

33:36 But it follows these four or five groups along who spend like a couple years doing just solo Indie Game development.

33:44 And either they're a great success or not so much at the end.

33:47 And it's, yeah, for people who are interested in this kind of stuff, that might be a good movie recommendation.

33:53 Oh, yeah, definitely.

33:54 I mean, I keep thinking like, I hear about Minecraft and Dwarf Fortress and a game that I recently got into, Stardew Valley.

34:01 And these are all created by sort of like solo or just like very small teams of people, usually one person, just over years.

34:09 And there were just these big labors of love that turned into this great thing.

34:12 And I was thinking like, oh, man, I could totally just spend the next four years of my life just sitting in a small room.

34:19 And I'll program something that's like a cross between Stardew Valley and Minecraft.

34:22 And I'd call it StarCraft.

34:25 There's no trademarks or anything.

34:26 It'll be great.

34:26 Nice.

34:27 Yeah.

34:27 I saw one of the guys that was on there.

34:28 He was featured on the Apple App Store with his sequel game.

34:33 So he must have gone somewhere with that.

34:35 That's cool.

34:35 Yeah.

34:36 So that's great.

34:36 So what other games do we have?

34:38 We have Hangman, of course.

34:39 Yes.

34:40 Yes.

34:41 And this game actually is sort of like the first major game in the book.

34:44 I've actually spread it across a couple chapters.

34:46 And I also talk about how you should write out flow charts for sort of designing what you want your program to do and how, you know, it's a lot easier to just change a flow chart around than it is to actually start changing code around if you later, like, come up with a better idea or something else like that.

35:03 So just doing a little design ahead of time and thinking about code before you start writing it.

35:09 Yeah.

35:09 You probably wouldn't do that too much as a professional developer these days.

35:12 But certainly when the concept of, you know, what is a function again?

35:16 Right.

35:17 When you're at that level, it does become hard to manipulate the code and whatnot.

35:23 So having it drawn out is nice.

35:25 Yeah.

35:26 And also it's just a flow chart is just sort of a natural way of depicting the flow of execution through a program.

35:34 Nice.

35:34 Okay.

35:34 So tic-tac-toe, does it play against you automatically?

35:38 How do you play tic-tac-toe?

35:39 Tic-tac-toe.

35:39 So this is a tic-tac-toe game against the computer and the computer is actually somewhat intelligent.

35:44 So it'll look, if it can win the game by making a move, it'll make that move.

35:48 And then it'll check if it can make a move that will block the player from winning the game, it'll make that move.

35:53 And then I think the algorithm goes on where it'll take any corner space that's free and then any side space that's free.

35:59 Or I think maybe it takes the center first.

36:02 But I really wanted to introduce the idea of you can actually have, you know, again, it's still just a bunch of function calls and if-else statements.

36:11 And sort of also the first time where I introduce a data structure, we have a data structure to represent the tic-tac-toe board.

36:18 And this data structure is what's used by a bunch of the functions to sort of plan out what the AI will do.

36:24 I remember trying to program this as a kid in BASIC by following some source code that I was copying and I could never get it to work.

36:33 I would just like try it and then like a couple weeks, you know, forget about it and a couple weeks later I would try it again and it would just never actually work out.

36:41 And so when I was writing this originally for the, I guess, seven years ago I think was when I first started writing this book.

36:48 It was kind of like a miniature triumph that I got the tic-tac-toe program working.

36:54 You will not haunt me anymore, tic-tac-toe.

36:56 We're done.

36:57 Yes.

36:57 I have produced my masterpiece right here.

37:00 Yeah, that's awesome.

37:02 But yeah, and the game continues on.

37:05 I have like a few other games.

37:06 There's like a deduction game called Bagels.

37:09 It's also called Mastermind where it's sort of your, it has three numbers and it tells you guess which numbers and it gives you clues where like if you've guessed one digit or if you've guessed a digit but it's in the wrong place.

37:21 That sort of deduction game.

37:23 And then I also have a small chapter on the, on a little encryption cipher program so that you can do the Caesar cipher cipher, whereas, which is where you shift the letter over by three characters.

37:36 So like an A becomes a D and a B becomes an E and then you decrypt it by just shifting the letters back.

37:42 But this was just like a really simple sort of like encryption program that you could make in Python.

37:49 It's not necessarily a game.

37:51 I thought it would just be like a really fun thing.

37:54 This episode is brought to you by GetStream.

37:57 If you're building an application that has some form of activity stream like you might see in Slack or Facebook or Instagram and others, then you owe it to yourself to have a look at GetStream.

38:07 They provide scalable, reliable, and personalizable hosted API feeds as a service.

38:12 The feed is the most intensive component of these types of applications.

38:16 Yet there's no need for you to reinvent the underlying feed technology when GetStream has the infrastructure and a Python API already in place.

38:24 Go from zero to scalable feed in hours, not weeks or months.

38:28 They even use advanced machine learning to serve up personalized results to each and every user.

38:33 Stream powers the feeds for over 500 companies including Makerspace and Fabric with a total of 70 million end users.

38:41 Try the API yourself in a short five-minute interactive tutorial at talkpython.fm/stream.

38:48 Try it for yourself.

38:49 It helps support the show.

38:50 Actually, this chapter sort of inspired me to go on later and I wrote an entire book full of these.

38:58 in hacking secret ciphers with Python.

39:00 Nice.

39:01 Yeah, I think ciphers are another thing that are pretty fascinating to people.

39:04 It's a parallel track to being interested in games.

39:07 These secrets and these secret ciphers are quite interesting.

39:10 Encryption is so complicated these days that it's not fun to look at anymore, but trying to solve things.

39:17 Especially when one minor oversight means that your entire system can fall apart.

39:22 Yeah.

39:23 Yes.

39:23 So I wrote an entire book of bad encryption in a modern sense.

39:27 They're terrible ciphers.

39:28 But these are all sort of like classical ciphers.

39:31 Caesar cipher literally goes back to the times of Caesar.

39:34 Was Caesar actually using it?

39:35 Yes.

39:36 So this was sort of the system where they would just shift letters over by three characters in the alphabet.

39:41 And that was how they would encrypt things.

39:43 Of course, back then, just writing things down was effectively encrypting things because most people were illiterate.

39:49 But, you know, just the idea of you're just seemingly writing a bunch of nonsense onto writing that down.

39:55 And then that, you know, anybody who intercepts that message would just be completely confounded because these concepts of encryption and, you know, treating letters as sort of generic symbols that can be manipulated according to some algorithm.

40:10 That just wasn't really common.

40:11 All that common.

40:12 So, I mean, the Caesar cipher was very effective.

40:15 Yeah.

40:15 I mean, it just seems like so basic.

40:18 And it's, you know, encryption for like a serious empire.

40:21 Right?

40:22 Yeah.

40:23 Yeah.

40:23 I mean, and so there are basically a few other different cipher schemes that came up.

40:29 But really, I think it was the visionier cipher.

40:32 I'm never certain if I'm pronouncing that correctly.

40:35 And it's really the visionier cipher is sort of like the Caesar cipher, except slightly more complicated.

40:42 And you have a different key for the first letter of, you know, if you have a key that's four letters long, then you have one Caesar cipher key for the first letter of a message.

40:52 And the second letter, you have a second key in the third letter.

40:54 You have a third key in fourth letter.

40:55 You have a fourth key in the fifth letter.

40:57 You go back to the first key.

40:58 And this was really kind of brain dead simple, but it remained effectively unbreakable.

41:05 They called it the indecipherable cipher in French, which I'm not even going to attempt to pronounce.

41:10 But I think Charles Babbage solved it, but never published or was able to break these messages, but never published his method behind that.

41:20 That's like back to the 1800s or something, right?

41:22 Oh, yeah.

41:22 Yeah.

41:23 I think it came about in like the 16th century or so, I want to say.

41:27 But for, you know, a couple hundred years, it was just unbreakable.

41:30 But, you know, these days, like anybody with a laptop and a little bit of programming knowledge could write something that can just do all the number crunching that you have to do to come up with to be able to break these ciphers.

41:41 So I wanted to sort of write an entire book on that.

41:44 Oh, yeah.

41:45 And so all of these Python books, you know, going from Invent Your Own Computer Games with Python, even the fourth edition and Automate the Boring Stuff and Hacking Secret Ciphers, I released under a Creative Commons license.

41:56 So you can find them online at inventwithpython.com and they've been copied to other sites, I'm sure.

42:01 I just really wanted to put this information out there and get it into the hands of as many people as possible.

42:08 Yeah, that's great.

42:09 And so people can go check it out and they can basically read it online there, right?

42:13 Or they can buy the tree version or maybe even a Kindle version, huh?

42:17 Yeah, yeah.

42:18 And the Kindle version is slightly, it's formatted much, much more nicely.

42:21 I just sort of have these HTML versions that I sort of hastily exported from Word.

42:27 But, you know, so all the information is there, even if you don't have the funds to pay for an actual like dead tree book.

42:34 And I get a lot of emails from sort of students and other people who are, you know, really thankful that information is there, that they can just read it off of their screen without having to buy a book.

42:44 Yeah, yeah.

42:44 That's really cool.

42:45 Do you know if your book is being used in any like classes, like official classes?

42:51 I do get some emails from a few teachers who say they're using sort of like invent with invent your own computer games with Python as part of a class.

43:00 I never really wrote it sort of to follow a curriculum or to be teachable, you know, in 45 minute or 90 minute class period.

43:09 But, you know, I'm really glad that, you know, it has some examples that they can pull out, especially being online and under a Creative Commons license where they can easily just copy and paste the sections they need and print it out as needed.

43:22 So I'm really glad that it's just produced some material that teachers can make use of.

43:28 Yeah, that must be really cool to think that there's probably kids out there learning through your book.

43:32 And also really terrifying, just in case I have any typos or weird practices of mine.

43:38 I should have actually made that more clear how this works.

43:41 Don't actually do this for real people.

43:44 So you kind of wrap up things by talking about Pygame and you even have another book on Pygame itself, right?

43:50 Right.

43:51 So Pygame is a 2D graphics library.

43:54 It's Pygame's really a wrapper for another library called SDL that is very popular with programming 2D stuff with C++.

44:03 But Pygame really makes creating sort of graphical games so much easier.

44:08 You can just sort of point to a PNG image file on your hard drive and then just display it in a window and then start moving it around.

44:15 And it can support mouse input and also play media files.

44:19 You can play MP3s or WAV audio.

44:21 And I once wrote a blog post a long time ago about professional games that actually make use of Pygame.

44:28 I know that there's at least two or three of them that are on Steam, the PC game marketplace, that were originally just created in Pygame.

44:37 So Pygame is mostly seen as sort of a, you know, just sort of like a toy hobbyist library, but you can actually make commercial games with it.

44:48 That's really cool.

44:48 Yeah.

44:48 So a good 2D scroller might work well there, huh?

44:51 Oh, yeah, definitely.

44:52 Nice.

44:53 Yeah.

44:53 So at the end of Invent Your Own Computer Games with Python, I had a few chapters devoted to sort of just a very light introduction to Pygame, followed by one game programmed using Pygame.

45:06 And I thought like, wow, I have a lot of other ideas for small games that I'd like to create.

45:10 So I thought like, well, I guess I'm writing another book.

45:15 And yeah, and so it was that was the second book that I wrote.

45:18 It was also self-published.

45:19 And then Hacking Secret Ciphers was self-published.

45:22 And this was all, you know, just a spare time hobby of mine.

45:27 But it was sort of this was what built up my confidence into thinking like, hey, OK, I have an idea for a book that could be really, you know, possibly really popular that I would want professionally published.

45:38 And that's sort of when I approached No Starch Press about publishing Automate the Boring Stuff with Python.

45:44 That's really cool.

45:45 Was it weird?

45:46 Like, when did you first start describing yourself as an author to other people?

45:50 When they go, hey, what do you do?

45:52 Like, I'm a programmer.

45:53 Leave me alone.

45:54 It's always been weird because I thought like, well, you know, it's just a self-published book is what I would always tell people.

45:59 I guess it was really sort of with, you know, Automate the Boring Stuff.

46:03 You know, I would go to Python meetups and people would know who I am because of that book.

46:08 Or I would go to PyCon and people would have heard of me.

46:11 And it's a strange feeling that never quite stopped being strange.

46:16 Yeah.

46:16 But, you know, it's also a great feeling.

46:18 I remember I came over to see you at the No Starch Press booth last year at PyCon.

46:23 And that's how I found you.

46:24 Yes.

46:24 At PyCon.

46:25 Hang around with the books.

46:27 Right on.

46:27 Yeah.

46:28 I remember at that PyCon, I had two people who wanted to take selfies with me.

46:33 And so I kind of felt like a rock star.

46:35 And it's, you know, I mean, our industry talks a lot about imposter syndrome.

46:40 But I feel like I have enough experience under my belt right now that I still feel like an imposter.

46:46 But I'm pretty sure I'll get away with it for the rest of my life.

46:49 You've pulled it off for enough years that you think that the trail's gone cold.

46:55 I am completely confident in myself that no one will ever find out what a fraud programmer I really am.

47:01 Nice.

47:02 So speaking of the trail, what books are you working on next?

47:07 So, yeah.

47:07 So I have the Minecraft book that I'm working on.

47:10 And I keep coming up with ideas for, I don't know, like automate the boring stuff with JavaScript.

47:15 Or maybe sort of a SQL to automate where you're using Flask to create really small applications.

47:23 So, and again, this would be sort of for office workers who have something that they, you know,

47:28 some custom software that they would like to have written that's really small,

47:31 but they don't want to hire, they don't want to like contract out a programmer to write it for them.

47:36 I was thinking like, well, you know, you could actually use Flask in the browser for all the UI components and everything like that.

47:42 And I thought like, okay, that would be pretty good.

47:44 And then I just keep poking around with other ideas.

47:47 So, but for right now, the Minecraft book is the one I'm working on.

47:53 And I'm also creating a website that is set up so that readers of that Minecraft book can then go on and write their own programs for Minecraft robots.

48:03 And then go to this website to share their programs with a lot of people.

48:07 I use this tool called Scratch from MIT in a lot of teaching to programming to kids.

48:14 It's a great system.

48:16 It's has sort of this like snap together block interface for creating games.

48:20 I really like it.

48:21 I used it for my youngest daughter's hour of code.

48:25 I went in hour code in like elementary school for all the grades, eat one grade at a time.

48:31 And we used it and I was blown away at how good the kids could do stuff with it.

48:35 Oh, yeah.

48:35 I mean, the one thing that I've learned is that especially young kids really have problems typing or, you know, they're just like pecking at the keyboard one key at a time.

48:43 And it's really frustrating to type that slowly and then realize you left out a semicolon and now you get some weird error message.

48:50 And Scratch fixes that with this snap together block system where it becomes literally impossible to make a syntax error in your code because the blocks just don't fit that way.

49:01 And I just, you know, the more I used it, the more like clever design decisions I realized they had made behind the scenes.

49:07 And the other great thing about Scratch is not only did they really nail down the editor, but the Scratch, Scratch runs in a web browser.

49:15 And also it has a website where you can share all of your programs with other people and also view the source code of other people's programs.

49:24 So, you know, if you find some game that's really clever, you know, you have the motivation that you want to create something cool to show off to people.

49:30 And learn more programming to do that.

49:32 But also if you find a really cool game, then you can just, you know, click on one button and it'll show you the source code behind that.

49:39 And that's sort of something I had been thinking about, like, okay, I really want to create a website like that for this Minecraft robot programming book.

49:46 And also I've been sort of thinking like, oh, maybe I could create something like that for Pygame specific games as well.

49:53 That would be really, yeah, that'd be really fun.

49:55 Yeah.

49:55 You could, you could totally do that.

49:56 A little bit of Docker, a little bit of GitHub.

49:58 Yeah.

50:00 Yeah.

50:00 Yeah.

50:00 Exactly.

50:01 I mean, yeah.

50:02 So, you know, and hence why I'm teaching myself like Bootstrap and a whole bunch of other web frameworks and things like that.

50:08 Of course.

50:09 I like Bootstrap.

50:10 I use it for all my sites as well.

50:11 It's great.

50:13 All right.

50:13 Well, so you're working on the Lua book.

50:16 You've got the website coming.

50:17 Like, how do people keep up with this?

50:19 Like, how will they know when this comes out?

50:22 Probably the best way is to probably follow me on Twitter, actually.

50:27 But then also I have, I'm restarting, I had a blog on inventwithpython.com that I used to post little tutorials to, and I'm ramping that back up again.

50:37 So it's, if you just go to inventwithpython.com and then click on the link to the blog, that's probably like the best way to keep up with what I'm doing.

50:46 And I also have, oh, I also have alswigert.com, which is a really plain looking website.

50:53 But I kept losing track of like, oh, yeah, I created this Udemy course for Automate the Boring Stuff.

50:58 In fact, I think I forgot to mention that in this podcast.

51:02 Yeah, yeah.

51:03 So why don't you tell people about it?

51:04 Because you do have a pretty popular course on Udemy, right?

51:08 Yeah.

51:08 Around your book.

51:09 Yeah.

51:10 So this was like shortly after Automate the Boring Stuff came out.

51:14 And I kept thinking of like, how can I help promote this book?

51:16 And so I found Udemy.com.

51:19 So there's a lot of these websites online that have video courses, but most of them you have to be affiliated with a university.

51:27 I think like Coursera or edX, you have to be a professor, essentially.

51:30 Udemy.com has courses that can be created by anybody.

51:34 And so, of course, you know, it does have sort of like a lot of really low quality courses on it.

51:39 But I thought like, well, okay, I can try this out.

51:42 And so I started making screencast tutorials, basically following along with Automate the Boring Stuff.

51:47 And that course actually sort of is the other half of my income.

51:52 I mean, it's sort of making as much as Automate the Boring Stuff the book.

51:56 And I'm really just blown away by, you know, like, well, okay, I can actually, you know, it wasn't entirely dumb to quit your job as a software developer and enter the lucrative world of, you know, books.

52:09 Yeah, I think the trick or the thing you got right is you've got the book, you've got the website, you've got the course.

52:16 It's like you sort of got a package around it.

52:19 It's not just like, oh, here's a book I did.

52:20 Go forth and like live in the world book.

52:23 You've got the promotional angles and the different stuff going.

52:26 Yeah.

52:26 Yeah.

52:26 Yeah.

52:26 I try to just create a whole bunch of things that sort of support each other.

52:29 And, you know, and of course, all of this is just only possible because so many people in the Python community are so excellent about spending their time and skills making Python even better and just building the community.

52:42 It's something that I really haven't seen anything close in other programming communities.

52:46 So the Python and also PyCon, the Python conference, they just blow my mind.

52:53 It's really great.

52:54 Yeah.

52:54 I definitely second that.

52:55 And for people who don't have your PyCon ticket yet, better hurry.

52:59 It's going to be sold out and you're going to be sad, right?

53:01 I have a booth there with the podcast booth.

53:04 And are you going to be there?

53:06 Oh, yeah, definitely.

53:07 Definitely.

53:08 Yeah.

53:09 It's not that far from San Francisco to Portland, right?

53:11 Oh, yeah.

53:12 Not at all.

53:12 In fact, last year it was also in Portland.

53:15 They do it in the same city for two years before switching.

53:17 And I went up with a bunch of people on Amtrak.

53:20 So there was a group of people starting in San Jose, making their way up the coast, taking a train to PyCon.

53:27 So that was a lot of fun, just hanging out with conference goers beforehand.

53:31 I think it was called PyCon on a train or something like that, or Pythons on a train.

53:37 But yeah, you can probably, if you're interested in finding out about that, you can probably Google for that.

53:43 Oh, that's awesome.

53:44 It's about a 15-minute drive from my house to PyCon this year.

53:47 So no trains for me.

53:48 Oh, right.

53:48 Yes.

53:49 But maybe sometime soon I'll get a chance, although probably not to Ohio next year.

53:54 Right, right.

53:54 But definitely, if you guys are interested in going to PyCon and want to do a selfie with Al,

54:01 you've got to get yourself there.

54:02 All right, man, that's awesome.

54:05 So it sounds like you have a lot of cool stuff brewing.

54:07 And this book is really interesting.

54:09 And thanks for chatting through it with me.

54:11 Yeah, thanks for having me.

54:12 You bet.

54:12 Before I let you out here, two more questions.

54:14 We just passed over 100,000 packages on PyPI.

54:18 What one of those few would you like to recommend that people check out they maybe don't know about?

54:23 Well, if I want to be totally selfish, PyAutoGUI, because it's a package that I wrote.

54:29 It's a GUI automation package where essentially you can have your Python scripts control the keyboard and mouse.

54:35 So if you just have some task where you need to like click on something over and over again or just like automatically fill out a form and type something for you, you can use this to essentially sort of like simulate having an intern type and click for you.

54:49 But I think really I'm really impressed by the requests module.

54:54 So requests is a really simple to use sort of version of what URL lib in the Python standard library does for making HTTP requests.

55:04 Except requests just makes it so easy to just download files or access websites.

55:10 And I'm just really impressed by it.

55:13 And so I highly recommend that.

55:14 Yeah, I definitely second that.

55:15 It's a very, very nice one.

55:16 Awesome.

55:17 And favorite editor, Idle?

55:19 I mean, these days I'm mostly using Sublime Text.

55:22 So I've kind of gone the text editor route rather than having like a full-blown IDE.

55:27 So yeah, I think I would go with Sublime Text.

55:30 But, you know, I guess Idle technically counts as an IDE.

55:33 So I would say my favorite IDE is Idle.

55:35 Oh, right on.

55:37 All right.

55:37 So it's been great to chat with you about this.

55:40 Final call to action.

55:41 What should people do to learn more about what you're up to?

55:45 Oh, well, I guess like alswigert.com has just links to, everything I've done.

55:50 But really, like as far as a call to action, definitely get involved with your local Python

55:55 community.

55:55 If you live in a large city, there's bound to be like a meetup.com group for Python.

56:01 Or definitely think about heading out to PyCon, even if you're still a beginner in Python

56:05 or, you know, you're not yet a professional software developer.

56:08 It's such a great and welcoming community that I really recommend it for a lot of people.

56:12 All right.

56:13 I totally agree.

56:13 Great recommendation.

56:14 Al, thanks for being on the show.

56:16 Chat with you later.

56:17 Yeah.

56:17 Take care.

56:18 Bye.

56:19 This has been another episode of Talk Python to Me.

56:22 Today's guest has been Al Swigert.

56:24 And this episode has been sponsored by Intel and GetStream.

56:27 The Intel distribution for Python delivers the high-performance Intel C libraries built right

56:33 into Python.

56:33 Get close to 100 times better performance for certain functions when using NumPy, SciPy, and

56:39 Scikit-learn.

56:39 Check them out at talkpython.fm/intel.

56:43 If you're building an app with a feed, make sure to check out GetStream at talkpython.fm

56:48 slash stream.

56:49 They have the intelligent, scalable, and tested feed API you need to be one step closer to

56:54 launching your app.

56:55 Are you or your colleagues trying to learn Python?

56:59 Well, be sure to visit training.talkpython.fm.

57:02 We now have year-long course bundles and a couple of new classes released just this week.

57:07 Have a look around.

57:08 I'm sure you'll find a class you'll enjoy.

57:10 Be sure to subscribe to the show.

57:12 Open your favorite podcatcher and search for Python.

57:14 We should be right at the top.

57:16 You can also find the iTunes feed at /itunes, Google Play feed at /play, and

57:21 direct RSS feed at /rss on talkpython.fm.

57:25 Our theme music is Developers, Developers, Developers by Corey Smith, who goes by Smix.

57:30 Corey just recently started selling his tracks on iTunes, so I recommend you check it out at

57:35 talkpython.fm/music.

57:37 You can browse his tracks he has for sale on iTunes and listen to the full-length version of the

57:42 theme song.

57:42 This is your host, Michael Kennedy.

57:44 Thanks so much for listening.

57:46 I really appreciate it.

57:47 Smix, let's get out of here.

57:49 Smix, let's get out of here.

57:49 spinner preview, back to who rocked the best.

57:59 I'm first developers.

58:01 I'm first developers.

58:08 Developers, developers, developers, developers, developers.

58:11 you you

Back to show page
Talk Python's Mastodon Michael Kennedy's Mastodon