Conversation with Albert Sweigart - Author of Automate the Boring Stuff with Python
From ImportPython Blog

by Ankur Gupta

Al Sweigart is a software developer and teaches programming to kids and adults. He has written several Python books for beginners, including Hacking Secret Ciphers with Python, Invent Your Own Computer Games with Python, and Making Games with Python & Pygame.

Having worked with TechED startups, I have witnessed first-hand the impact of Albert's book Invent with Python on students learning the ropes of programming. We are happy to have him with us for a coversation around Python, Books, Python in Education.

What got you started in the TechED space? Where did the motivation for Invent with Python come from ?

Around 2009 a friend was a nanny for a precocious 10-year-old who wanted to learn how to program. I thought this would be straight-forward web search, but the materials I found didn’t quite meet my needs. There were plenty of (costly) books for professional software engineers and plenty of computer science freshmen materials, but most people don’t kindle a joy in programming by calculating Fibonacci numbers.

So I started writing a tutorial on how to make simple games. I put the game projects in front of the concept explanations, only explaining enough about Python programming to get the reader through that particular game. Then I wrote another game, then another. Eventually this tutorial reached book-length, and some friends suggested I self-publish Invent Your Own Computer Games with Python.

People responded well enough to the book that I wrote Making Games with Python & Pygame for making games with 2D graphics and Hacking Secret Ciphers with Python for making encryption and code-breaking programs. In early 2014 I left my software developer job to write Automate the Boring Stuff with Python full time.

Congratulations on your new book Automate the Boring Stuff with Python. Who is the target audience for this book ?

There have been times when I’m chatting with non-programmer friends who incidentally tell me stories like, “Today at the office I spent three hours opening PDFs, copying a line, pasting it into a spreadsheet, and then moving on to the next PDF. Three hours.” And I used to tell them that they could have written a program to do that for them in fifteen minutes, but that news would sometimes crush them. They can’t believe how much effort they could have saved.

A computer is the primary tool for office workers, researchers, and administrators. They may have heard “everyone should learn to code” but not know how to get started or how exactly coding will practical for them. Automate is a Python book for people who have never programmed before and, while they don’t necessarily want to become software engineers, they want to know how they can make better use of their computers to save them time. It’s a programming book that skips computer science and focuses on practical application.

Which version of Python is the book written for? One FAQ is which version of Python should one learn/use? Does it make a big difference from a beginner's standpoint ?

The book uses Python 3, specifically, 3.4. There have been some backwards-incompatible changes (for the better) that were made between the 2.x and 3.x versions, but Python 3 was introduced several years ago now. The reasons to stall on upgrading, such as lack of Python 3-supporting modules, mostly no longer apply. The only excuse to use Python 2 is if you have a large existing program written in 2 that, despite all of the Python 3 migration tools that are available, can’t easily be upgraded.

But these are all technical details that don’t really apply to beginners; just use 3.

How has the experience been of writing a book for a publisher vis-a-vis self-publishing for you ?

As great as self-publishing and print-on-demand have been, it has been excellent working with a publisher like No Starch Press. I soon learned that when writing a book the writing was the easiest part. Editing, formatting, layout, and especially marketing were all hats that I had to wear when self-publishing, and at times I wore them poorly.

Self-publishing is an excellent gateway for new, unknown writers, and a good way to get feedback and experience of the entire process by frequently releasing short works. But working with a professional team let me focus on the content, and the final book is of much higher quality than the ones I produced on my own.

Having spent a large part of my career creating Visual Programming Language for Kids, I feel Visual Programming Languages like Scratch, CiMPLE, etc. are a better first step for children vis-a-vis Python. From a pedagogy standpoint, what are your thoughts on this ?

I am a huge advocate of Scratch in particular. It’s clear that they’ve done a lot of research to make their user interface on a par with Apple’s best products. Scratch is great for the 8–12 age group. It has instant, graphical feedback and the snap-together block interface makes it literally impossible to make syntax mistakes from typos. It’s incredibly frustrating for a child to slowly type out a command, only to be greeted with an obscure error message because of a typo. But from discussions with other educators, kids can quickly outgrow the limitations of Scratch. Teenagers are more than capable of putting together programs in a high-level language like Python (or even younger, if they are enthusiastic about programming).


Ankur has coded and deployed numerous Python software over the last 10 years, at three venture funded startup and a fortune 10 company. He currently heads Numerate Labs. ImportPython is his side project with Python being his go to programming language.

Blog Categories