An Interview With Al Sweigart, Author of Three Introductory Books on Python

Albert Sweigart is a software developer who lives in San Francisco.  To date he has published three introductory books on Python, all of which can be downloaded for free from his website Invent With Python.  Readers may recall the review of his most recent book, Hacking Secret Ciphers with Python, that I posted here last month, which was one of the most popular posts to date here at the aGupieWare blog.  Over the weekend, Al was kind enough to answer a few questions via email for an interview.  

Q: First, thanks for taking the time for this interview. Could you tell us a bit about yourself and your programming background? 

A: I started programming in BASIC when I was in the 3rd grade, which I always hate to say because it makes people believe that you have to start programming at a young age to become proficient in it. All of my programs up until college were pretty much variations of the same program. I didn’t really teach myself all that much, and these days anyone could do in a few months what I did in those several years.

Q:  You've published three introductory books on Python, all of which are available on your website inventwithpython.com.  The first two, "Invent Your Own Computer Games with Python", and its sequel, "Making Games with Python and Pygame," are geared toward kids, while the third, "Hacking Secret Ciphers with Python," seems to be intended more for an adult audience.  How have the three books been received? 

A: Altogether, the books seemed fairly well received. I was surprised that people liked my first book, which led me to continue writing. The Amazon reviews are almost exclusively 5 and 4 stars, and I get an occasional Thank You email from readers. “Hacking Secret Ciphers with Python” is probably a bit much for young kids, but I think teenagers and adults would be able to digest it.

Q: Do you see the cryptography book as a step in a different direction, or as an extension of the puzzles and games introduced in the earlier works? 

A: I saw it as a different direction. Video games are a great way to get people involved in programming, but I wanted something else as well. I noticed that there were a lot of code and cipher books that talked about the classical ciphers the book covers, but very few that explained how to break them and none about how to write programs to break them. I saw it as an opportunity to reach a broader audience. The book itself is also aimed at people with absolutely no prior programming or cryptography experience.

Q: What has drawn you to python?  What do you think are its strengths and weaknesses?   
A: Python is a very readable scripting language. Unlike Perl which has very obtuse use of punctuation characters for different language features, and unlike Java which has an overwhelming amount of boilerplate code, Python seems to be a very direct, “get it done” language. It also has a very gentle learning curve. I’ve written a blog article before about how Python isthe new BASIC.  I use Python for both my own software projects and for teaching programming. At this point, I’ve become so accustomed to Python and its idioms that I’m afraid I’ve become blind to its weaknesses, so I really couldn’t think of any.

Q: What are your favorite python modules?

A: Pygame is excellent for creating games and 2D graphical applications. I’ve written a couple modules that work on top of Pygame called Pygcurse and Pyganim, which add a curses-console for text games and sprite animation, respectively. Lately I’ve started using Requests and Beautiful Soup for downloading and parsing web pages for my Python script. (I’ve written a simple Reddit bot that automatically checks several different web comics and posts them to the r/comics section of the site.) I have some experience with wxPython for creating GUIs for traditional desktop apps, but I’ve heard good things about Qt bindings for Python as well.

Q: Do you currently have any new python books in the works?

A: I’m writing a new Python-for-beginners book with NoStarch Press, which tentatively has the title “Automate with Python”. I’ve described it as “a programming book for people who don’t want to become software developers”. I noticed a lot of office workers, administrators, and academics do a lot of computer-based tasks that involve a lot of mindless, repetitive clicking or compiling of data. This book aims to teach them just enough programming so that they can automate these tasks. It covers basic Python, and then goes into several different modules for text parsing, web scraping, moving and renaming large amounts of files, updating spreadsheets, or sending automated emails and text message alerts. I’m hoping to have it available by summer of 2014.

Q: You accept bitcoin donations through your website.  Have you worked on, or are you currently working on, any Bitcoin related projects?  Can you speak to the intersection of Bitcoin and Python? 

A: I had only added it to the site after other people on the internet suggested it, but I’m glad I did. As with many people, bitcoin had been in my periphery for a while. But setting up the wallet for the donation link forced me to learn more about it. Although as of yet I haven’t worked on any bitcoin projects (if anything, the Tor Project will get my focus once I’ve finished the next book). But for all the negative publicity that bitcoin gets regarding its use to buy drugs and illegal things (all of which, by the way, can apply to cash) I’m really excited about it. It allows minors and people in third world countries to conduct commerce over the internet, and that is a Big Deal.

As to Bitcoin and Python, I think that having a new ability to receive and send money over the internet without middlemen (e.g. Visa) along with open source software like Python really lowers the barrier-to-entry for software development outside of America and traditional software-producing strongholds.

Q: Like your other works, the cryptography book can be read online or downloaded for free.  But if a reader purchases it, you donate all proceeds of the book to the Electronic Frontier Foundation, Creative Commons and the Tor Project.  Why did you decide to donate the proceeds for the book on cryptography?


A: It was the suicide of Aaron Swartz, to whom the book is dedicated to, that made the decision for me. I hadn’t met Aaron, though I have friends who were friends of him. His passing was a tragedy, but also a wake-up call for myself. Looking at his life really made me start looking at mine and how I wanted to make contributions like he had. At the time I was, after two years of off-and-on writing, a couple months away from finishing “Hacking Secret Ciphers with Python”. The other books were selling well, and I had a day job that gave me a comfortable middle-class lifestyle. So I decided that I would turn the proceeds from the books over to help organizations that are doing some really wonderful and necessary things to protect the internet.

Q: What advice would you give to young and not so young beginning programmers?  


A: My main piece of advice is that you suck at coding and will continue to suck for the rest of your life. Once you’ve accepted that, you’ll be able to move on and write some interesting software. Don’t worry about the nagging feeling that you aren’t good enough or know enough, because that feeling will be permanent no matter what you do. And if it doesn’t, it’s because you’ve given up on forcing yourself to learn new things (which is the real danger.)

Also, you’re never too old or too bad at math to learn to code. Most programming doesn’t even require mathematical knowledge beyond arithmetic, and unless you’re in your sixties or seventies you aren’t even too old to become a professional software developer. Programming isn’t something that requires you to be a super genius to do. More than anything, having an interest and motivation to act on that interest is all you need to be set on the right path.

Q: Thanks for taking the time to answer our questions!

No comments:

Post a Comment