Learn How to Program!
Free eBook Programming Tutorial
for Python Games!
Invent Your Own Computer Games with Python is a free book (as in, open source) and a free eBook (as in, no cost to download) that teaches you how to program in the Python programming language. Each chapter gives you the complete source code for a new game, and then teaches the programming concepts from the example.
Invent with Python was written to be understandable by kids as young as 10 to 12 years old, although it is great for anyone of any age who has never programmed before.
This second edition has revised and expanded content, including a Pygame tutorial library to make games with graphics, animation, and sound.
The book and the programs are open source, and are available under a Creative Commons Attribution-Noncommercial-Share Alike license, meaning they are free to copy and distribute. See the license for full details. A print copy can be bought on Amazon.com
Vote for this site on Stumble Upon
| Tweet |
Quick Download Links
- Python 3.1 installer (for Windows)
- Python for other operating systems (Mac, Linux)
- Pygame for Python 3.1 installer (for Windows)
- Book PDF

- Book HTML
- Source Code of the games.
Amazon Reviews and Testimonials
This book is totally appropriate for someone who has never programmed before. Everything is explained, right from the ground up, in a lively, interesting style which doesn't dumb things down.
I am a college professor who occasionally teaches courses for liberal arts students. [...] I offered a game programming course in the Python programming language using Sweigart's book. The students loved this book. It starts at the very beginning and leads them, game by fascinating game, to become highly capable programmers.- Dr. Robert C. Gann
Read full Amazon review
I picked up a copy of this book and was in all honesty blown away by how easy the concepts of python are introduced to the reader in a clear and concise manner. The fact that you are also making small little games with your programs throughout this book helps with motivation as tasks get harder and harder - it keeps it all fun while learning. [...] I e-mailed the author and got great personal help to advance further - that was of course much appreciated as well.- Tor Hagen
Read full Amazon review
This Spring, we used this book for six weeks of a homeschool "Physics and Modeling" class. I am extremely happy with the book. It received many compliments from the students for ease of use, the hands-on approach, and the fact that game programming starts right away.
I used to write a column on a greek magazine about learning Python and PyGame. [...] Since I found this book, every time the topic of learning programming is mentioned - especially from a person interested on making games - I point people to it.- Konstantinos Michalopoulos
Read full Amazon review
My name is Felix. I'm ten years old, and I really liked your book on game programming with python.- Felix D.
Thanks so much for Invent with Python! I�m an artist, I always had programming/math phobia, but... since python is included in several of the programs I use, I figured it�s time I took the plunge and learned how to program � at least with Python to start � �Invent with Python� has been a great resource so far.- Jay B.
I just discovered your site and I wanted to thank you for your site and your book, which I just bought.
I tried to learn Java for one year and a half before I realized there are languages that are much easier to learn and much less verbose. Nowadays it seems the vast majority of books to start learning programming are super theoretical.
Your site is the best for adults like me. I think other authors in your field should follow your example and make their books fun and appealing to everyone. Because if a book is a bit boring or incomprehensible for a kid, chances are it will be the same for adults.- Hugo
Hi there Al, my name is Ignacio and I'm from Argentina.
First of all, thanks a lot for writing such a useful book as Invent with Python. I'm 22 years old and I work as Tech Support in an enterprise, but I don't have any (and I mean any) knowledge about programming, so I found your book awesome. I'm learning a lot through it about Python and programming itself, which will make a better proffesional of me. I really, really thank you.- Ignacio
Compare Prices
I want to make programming knowledge accessible to everyone. As such, Invent Your Own Computer Games with Python is free to read online. And I've priced the print version (available for sale on Amazon.com) for $25.00 (including free shipping) to make it affordable. Compare this with other programming books on Amazon:
News and Updates
The book's blog contains news and updates about this book.
Contact
You can email the author at [email protected]. Feel free to send your programming questions or comments.
Other programming guides for kids:
Here are some other free resources to learn programming (in Python and other languages):
- Hackety Hack (a programming tutorial in Ruby)
- How to Think Like a Computer Scientist: Learning with Python
- Snake Wrangling for Kids: Learning to Program with Python
- Python.org Official Documentation
- Hands-On Python: A Tutorial Introduction for Beginners
- The Guido van Robot Programming Language (a simplified form of Python, designed as a kid's tutorial)
- Greenfoot (programming in the Java language)
- PyMOTW - Python Module of the Week (a great site to learn about Python's other modules)
Once you've learned to make graphical games with Pygame, there are many resources for downloading graphics, music, and sound effects: Free Music, Sound Effects, Tiles, and 2D Art to Use in Your Games
Copyright © 2008-2011 by Albert Sweigart
"Invent Your Own Computer Games with Python" 2nd Edition is free to copy and distribute under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.