The Invent with Python Blog

Writings from the author of Automate the Boring Stuff.




How, As a Kid, I Taught Myself to Code

Sun 07 November 2021    Al Sweigart

I was one of those kids in the 90s who taught themselves how to code by making video games in the BASIC programming language. Later, I majored in computer science, moved to Silicon Valley, became a software engineer, started writing programming books including Automate the Boring Stuff with Python, and then quit my job to write full-time. I now wake up whenever I want and work from home or nearby cafes. I'm financially secure while being my own boss.

This is a completely true story.*

Read more...




Calm Programming Video Series

Sat 06 March 2021    Al Sweigart

I've started a new video series of me silently coding a small game project from scratch. The Calm Programming series are meant to be coding videos that you can watch while playing the music of your choice. They aren't quite the same as tutorials: they don't have screen capture and aren't narrated, though you can turn on captions for some explanations.

Read more...




Book Review: Code This Game! by Meg Ray (Odd Dot 2019)

Tue 12 November 2019    Al Sweigart

5 Stars: An excellent project-based book for young readers who want to move beyond Scratch

Code This Game is an excellent book that teaches Python programming by guiding the reader through making a tower-defense game from scratch. This is a book that doesn't shy away from programming detail, but manages to remain fun and engaging. If you have a student or child who wants to move beyond MIT's Scratch programming tool and do "real" programming, this is a great book.

Read more...


Book Review: The Little Schemer

Sun 09 December 2018    Al Sweigart

Alternative Title: The Little Schemer Wears No Clothes

Perhaps a software engineer or MIT professor friend of yours recommended this book to you. “Oh, you want to learn how to code? You should read The Little Schemer,” they’ll say. Your friend means well, but is completely wrong to recommend this book.

Read more...


How To Ask For Programming Help

Fri 02 February 2018    Al Sweigart

I often get emails say little more than "Why doesn't my program work?" Often I can't answer them; either I don't have enough information about your problem or you're asking me about something I don't know anything about.

Read more...



No, Seriously, Why Should I Learn to Code?

Tue 30 September 2014    Al Sweigart

The geeks have inherited the earth. A couple decades ago if you talked with friends in a chat room, you were cast as a socially-awkward nerd. Doing the same today just means you're a typical Facebook user. Broadband Internet connections and smartphones have taken the Information Age that technically started in the 1970s with PCs and pushed it into daily mainstream life.

Don't get me wrong: You should learn to program. But lost in this hype is a plainspoken reason: NO, SERIOUSLY, WHY SHOULD I LEARN TO CODE?

Read more...


Why Is HTML Not A Programming Language?

Sun 15 December 2013    Al Sweigart

HTML is not a programming language. You can't write a "program" that, say, calculates the average of ten numbers with HTML. While some may point out that HTML is a "markup language", this doesn't clarify how that is different from a programming language. This isn't meant to be a thorough argument, but rather a brief explanation that goes just a bit more in detail than "HTML isn't a programming language but instead a markup language."

Read more...


Decimal, Binary, and Hexadecimal Odometers

Thu 20 June 2013    Al Sweigart

It can be difficult to see how other number systems (such as binary and hexadecimal) work since they have a different amount of numerals than the ten numerals of decimal. But imagine that you are counting in these number systems using an old-fashioned analog odometer that has a different amount of numerals for each digit.

Read more...





How Does Compression Work?

Fri 17 August 2012    Al Sweigart

"Zip" programs that can compress multiple files into one smaller .zip file are fairly popular for downloads since the fewer bytes you have to download the faster it will download. But how do you compress files? Files are made up of ones and zeros, which can't be squished like clothes into a tight suitcase.

Read more...