The Invent with Python Blog

Writings from the author of Automate the Boring Stuff.


Sat 26 June 2021

New Book: The Big Book of Small Python Projects

Posted by Al Sweigart in news   

My new book, The Big Book of Small Python Projects, is now available from No Starch Press. It's free to read online under a Creative Commons license. This book contains 81 small but complete programming projects written in Python. These projects are designed to help new programmers who have learned the basics see what real programs "look like". These aren't code snippets, but actual, full programs that you can run. At the same time, they are small enough so that their source code is easy to understand.

Read more...



Sat 06 March 2021

Calm Programming Video Series

Posted by Al Sweigart in programming   

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...









Tue 12 November 2019

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

Posted by Al Sweigart in programming   

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...





Wed 05 June 2019

Pythonic Ways to Use Dictionaries

Posted by Al Sweigart in python   

Python dictionaries are a useful part of the language. In addition to having the ability to store keys and values, you can also use dictionary methods to manipulate those values, and you can use dictionaries to write more concise code.

Read more...



Sun 09 December 2018

Book Review: The Little Schemer

Posted by Al Sweigart in programming   

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...


Mon 22 October 2018

A Curriculum for Python Packaging

Posted by Al Sweigart in python   

Python's packaging ecosystem contains multitudes. It can be intimidating for new Python developers to try to crack into, especially given the rapid evolution of Python packaging. Writing a *helloworld.py* file and running it on your computer is simple, but getting it to run on someone else's computer (and doing this the "right" way) involves a tangle of terms, tools, and techniques. What are wheel files? What is distutils? Do I use distutils or easy_install or pip?

To get to the bottom of this myself, I've compiled a curriculum of PyCon talks, online documentation, and my own personal notes to finally get a complete handle on Python packaging.

Read more...


Wed 17 October 2018

Writing Bots to Play Zombie Dice

Posted by Al Sweigart in python   

Programming games are a games genre where instead of playing the game directly, players write bot programs to play the game autonomously. I've created a Zombie Dice simulator, allowing programmers to practice their skills while having fun making game-playing AIs. Zombie Dice bots can be simple or incredibly complex, and are great for a class exercise or an individual programming challenge.

Read more...