Posts Tagged With 'python'

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

posted June 16, 2010. It has four comment(s).

tagged with: profiling python snippet tutorial

An Introduction To Swig

SWIG is a tool that allows you to easily interface c/c++ with many scripting languages. I'm going to show you an extremely simple example to get you started using it. We're going to be interfacing some simple C++ code with python (3.1). I'm using Linux . ...

posted May 23, 2010. It has four comment(s).

tagged with: c++ python SWIG tutorial

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

posted April 21, 2010. It has five comment(s).

tagged with: python snippet timer watchdog

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

posted April 3, 2010. It has 342 comment(s).

tagged with: convert format grayscale greyscale pygame python snippet surface

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

posted April 1, 2010. It has four comment(s).

tagged with: AND-based filesystem lookup project python snippet sqlite3 tagging