The Invent with Python Blog

Writings from the author of Automate the Boring Stuff.

PygButton - Designing a Button UI Module for Pygame

Tue 30 October 2012    Al Sweigart

A button is a common user interface (UI) control that is used in many software applications. It seems simple enough: there's a button on the window and you click on it and something happens. But there's a lot of details we should plan out ahead of time. Remember, we want to make a generic button class so that other programmers can use this in their games and programs. Once you've read through the process here, you'll be familiar with how to make your own modules for UI elements.


Pygame Cheat Sheet

Fri 07 October 2011    Al Sweigart

If you already know a bit of programming and Python, and want to get up to speed on the Pygame 2D game framework, here's a cheat sheet that you can look over. It implements a very short Pygame program covering most of Pygame's basic features.


Virtual Caesar Cipher Wheel program

Sun 18 September 2011    Al Sweigart

The Caesar Cipher Wheel is a paper cutout that can be used to perform encryption and decryption in the Caesar Cipher. However, if you don't have a printer but do have Python and Pygame installed, you can use this Caesar Cipher Wheel program to rotate a virtual cipher disk instead.