Posts categorized “News”.

Pygame Basics Chapter

Here’s the introductory chapter to my next book on Python and Pygame. It assumes you have some Python and programming experience (if you don’t, give a look to Invent with Python), and offers a quick view of all of the major parts of Pygame.

The chapter by itself is a good introduction to Pygame. If you’ve been meaning to give Pygame a look, then download the chapter. Please email in any questions or suggestions you have: al@inventwithpython.com

Chapter 2 – Pygame Basics

Unfortunately, the links in the book aren’t working yet, but should be in a few days.

Chinese Translation of “Invent with Python” Started

Yuanle Qiu has started translating the “Invent Your Own Computer Games with Python” into Chinese. The first three five chapters are done, with more on the way. Thanks a lot Yuanle!

If you or someone you know can participate in translating “Invent with Python” into other languages (Hindi, Spanish, French, German, etc.) please contact Al for more information. “Invent with Python” is released under a Creative Commons license, so the translated works would be freely available to those who want to learn programming.

55.6% off “Invent with Python” book until the end of the week.

(UPDATE: I’ve discontinued this sale, but I’ll leave this post up for the record. If you are an educator and would like to buy discount copies of the book, feel free to email me for a discount code.)

I’m putting a sale on hard copies of the “Invent Your Own Computer Games with Python” book until the end of this Saturday. The discount is 55.6% (the max discount I can apply that brings my royalty down to $0.00 for each copy sold) which brings the price of the book to $11.11. To buy a hard copy of the book with this discount, use the following link and discount code:

https://www.createspace.com/3430836

Discount code: E4VHZFT5

The book is, of course, available online in full for free as HTML or a PDF.

Textbooks and tech books (especially geared towards young adults) are ridiculously overpriced. I put “Invent with Python” at $25 to put it within reach of kids (and adults) who want to buy it for themselves (and $25 would qualify it for free shipping on Amazon). Programming is a fun, creative skill to learn, and I’d like to be able to put it in the hands of a few more people with an additional discount.

Hey! Listen! If you’ve read the book before and liked it (or even hated it), the absolute best thing you could do to help me out (moreso than buying a copy) is writing a review on Amazon.

Also, if you are an educator or would like to buy single or bulk copies of this book at this price in the future, email me for the discount code at al@inventwithpython.com.

Pygcurse – A “curses” Emulator Built on Pygame

Pygcurse (pronounced “pig curse”) is a curses library emulator that runs on top of the Pygame framework. It provides an easy way to create text adventures, roguelikes, and console-style applications. The mascot of Pygcurse is a blue pig with a skull tattoo on its butt.

Download Pygcurse and Demo Programs.

Read the Pygcurse tutorial.

View the Pygcurse homepage.

Pygcurse provides several benefits over normal text-based stdio programs:

  1. Color text and background.
  2. The ability to move the cursor and print text anywhere in the console window.
  3. The ability to make console apps that make use of the mouse.
  4. The ability to have programs respond to individual key presses, instead of waiting for the user to type an entire string and press enter (as is the case with input()/raw_input()).
  5. The ability to use any font and any character in those fonts.
  6. Since the console window that Pygcurse uses is just a Pygame surface object, additional drawing and transformations can be applied to it. Multiple surfaces can also be used in the same program.

Pygcurse also provides some additional features that curses normally doesn’t, such as tinting, shadows, textboxes, and line drawing functions.

Pygcurse requires Pygame to be installed. Pygame can be downloaded from http://pygame.org. Pygcurse can be used with either Python 2 or Python 3.

1000th Book Sold!

I’d just like to announce that “Invent Your Own Computer Games with Python” has just sold its 1000th hard copy since it’s gone on sale last May. I’d like to say a general thanks to everyone who has found this book useful. Thank you!

If you like the book, it would be great if you could write a review for it on its page on Amazon.com.

I am Boycotting Amazon for the Holidays

I wrote a book to teach kids and beginners computer programming by making games entitled, “Invent Your Own Computer Games with Python”. After a few months of distributing it online for free, I began to use the print-on-demand service at CreateSpace.com (owned by Amazon.com) to self-publish the book. I continue to make the book available for free online ( at http://inventwithpython.com ), but it was nice to receive a form of compensation I could buy burritos with.

CreateSpace.com continues to be a great service, and it makes it easy to publish on Amazon.com. But after Amazon.com has expelled WikiLeaks from its web hosting service, I have decided to pull my book from Amazon and boycott their site for the holiday season.

I encourage others to do the same.

Disabling the sale of Invent with Python

“Invent with Python” will probably still be for sale on Amazon via third party dealers with used copies, but I’ve instructed the CreateSpace.com to disable selling new copies of the book. I’ll continue to provide the full PDF online for free, because it’s always been more important to me to get it in the hands of readers than to make a buck off of it. (That, and dividing the not insignificant amount of money I’ll make from it by the very, very significant number of hours I put into it would be too depressing.)

In a way, this is an easy decision for me to make. I’m not dependent on book sales to provide me with a living, and boycotting Amazon.com for the holidays will only be an inconvenience. But this makes it all the more important that I don’t simply follow the easy path of silent complicity.

It will cost me over a grand this month to not sell my book, but it will cost Amazon (by my estimates) twice as much. In the end though, it probably hurts me more than it affects a multi-billion dollar company like Amazon. But I feel it’s the right thing to do, and that often doesn’t come cheap.

There are alternatives to the online giant, and I’ll be taking a look at Powell’s Books, Half-Price Books, Borders, Barnes and Noble, Biblio and others for gifts this year.

I understand that Amazon has a duty to its shareholders to protect its business interests and entangling itself with powerful political cronies does not help its bottom line. But this is why it is up to us to make defending freedom of speech one of its business interests. Amazon’s own claims that it pulled WikiLeaks for violation of its Terms of Services and not due to political pressure are equally lame and preposterous. We must vote with our voices and our pocketbooks, and I hope to set an example for others with my actions.

I’d like to thank Daniel Ellsberg (of the Pentagon Papers fame) for his call to boycott.

EDIT: Here’s is an interesting and relevant link: Wikileaks Has Committed No Crime

EDIT (12/10): Damn it. I checked my createspace account this morning and found that even though I had the “extended distribution” (i.e. wholesale) channel disabled, they still sold 32 books to someone. I’ll be donating the proceeds from that to WikiLeaks. I haven’t seen any other sales aside from those.

“Invent with Python” Available in Print on Amazon

Invent Your Own Computer Games with Python, 2nd Edition, is now available in print on Amazon.com:

Buy “Invent Your Own Computer Games with Python” on Amazon.com

Of course, the book will still be available online, in full, for free under a Creative Commons license. If you like the book, but don’t/can’t buy the print version, go to Amazon and put in a review.

I’m very excited about this. Thanks to all the readers and people who have emailed me. Thanks!

Printed book still being edited.

I’m currently doing a very slow and thorough read through of the book to weed out the last of the typos, errors, and ambiguous statements in the book. Currently I’m about 2/3 of the way through the book, so it may be another couple of weeks from now that the book will be available for sale in print.

Afterwards, I plan on adding more videos and online traces to the website. A forum is also in the works, as soon as  potential spam issues are worked out.

Of course, the book will remain free online now and after the book goes for sale.

“Invent with Python” printed book on the way!

I’ve received a proof copy of the book from CreateSpace.com a few weeks ago and have finished editing it. Now all that remains is redoing the layout, sending off for another proof copy, and then making sure everything is okay. If all goes well, hopefully the book will be for sale within the next four weeks. I’ll post more updates on this blog as they happen.

The book will remain online for free under a Creative Commons license.

New “Choose Your Own Adventure” Game

Having a “Choose Your Own Adventure” style game for readers to look at was suggested to me, so I quickly wrote one up. The code is designed to be very simple, despite its length. There is no accompanying chapter, but I do provide a short description page.

The source code:

http://inventwithpython.com/extra/dragon2.py

The description page:

http://inventwithpython.com/extra/dragon2.html

These links are also on the Extras page on the main site.

Switch to our mobile site