Pygame Abstraction

This is a simple script that I use for all my pygame programs, just because it makes the whole business of creating a window and receiving events a little bit easier . ...

Profiling In Python

I received a request today to write a post about profiling C extensions in Python and here it is. I'm going to show you a little module that I wrote that acts as an interface layer for extensions by explaining how I made it. To begin with we need something to profile, to keep it simple we'll use the standard library : ...

A Watchdog Timer In Python

I have lots of snippets of code that are extremely useful to me in a great deal of projects and I'm going to put as many of them as I can on this website in the future. The first one I'm going to share with you is a watchdog timer. Basically what it does is raises an exception on portions of code that take too long to complete. As ever, there's not warrenty of any kind and it's being put into the public domain. I'm not sure it'll work on windows . ...

Pygame Greyscale

For varies reasons I wanted to convert a pygame surface to greyscale this morning, but I couldn't find a decent solution on the internet. Converting to an 8bit surface then changing to a greyscale palette doesn't work as you may hope. The solution I eventually came up with is : ...

Tagging Files

I have many many projects and each of them resides in a different folder in my home directory. This makes finding anything a challenge if I haven't modified it in a while. I decided this morning that what I needed was a tag based file-system. Tags are used all over the internet. In technical terms, they allow bottom-up classification rather than the traditional top-down type system. This is more in tune with the way the human mind works and so it's more natural to use . ...