The Invent with Python Blog

Writings from the author of Automate the Boring Stuff.

How to Run Pip From The Python Interactive Shell

Thu 25 August 2022    Al Sweigart

Installing Python modules with the pip tool is surprisingly hard to describe to beginners learning to code. There are several potential issues: multiple Python installations, virtual environments, PATH environment variable settings. You have to introduce command-line terminals and file system navigation, and the differences between Windows and Mac/Linux. However, there is a line of code you can run from the interactive shell to handle all this for you.

Read more...


Introducing Humre: Human-Readable Regular Expressions

Tue 23 August 2022    Al Sweigart

Regular expressions (aka regexes) are a mini-language to specify a pattern of text to look for. However, regex syntax is composed of various punctuation marks that can be hard to remember. Humre is a Python module that gives a more human-readable syntax that works better with code editing tools. You can install Humre just like any other Python module with pip install humre and the full documentation is available in the git repo's README file.

Read more...



New Book: The Recursive Book of Recursion by Al Sweigart

Tue 09 August 2022    Al Sweigart

My new programming book, the Recursive Book of Recursion, is released in August 2022. The book covers several classic recursive algorithms and breaks down recursion's fearsome reputation as a programming technique. The book has the code for its numerous programs in both Python and JavaScript. When you buy it direct from the publisher, No Starch Press, you'll receive a DRM-free ebook copy with your print book order.

Read more...









Book Review: Make Python Talk

Thu 13 January 2022    Al Sweigart

Mark H. Liu’s “Make Python Talk” is a solid book for anyone who wants to leverage the power of the Python programming language to add speech capabilities to their programs. The chapters cover third-party libraries for speech recognition and text-to-speech in an engaging way.

Read more...


Book Review: Serious Python

Thu 13 January 2022    Al Sweigart

Serious Python by Julien Danjou is an excellent book for those who have gone through the "hello world" tutorials or those coming to Python from other programming languages, and want a book that teaches you not just how to write code, but how to write code the pythonic way.

Read more...


Book Review: Tiny Python Projects

Thu 13 January 2022    Al Sweigart

Writing for an intermediate audience is hard, but Ken Youens-Clark has nailed it with Tiny Python Projects. This is a great book for those who have dabbled with a few beginner Python tutorials but still feel like they don't "get" programming. The projects in this book are short and simple; perfect for beginners who want to get experience with actual programs instead of just code snippets.

Read more...





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