A few days of purgatory

Posted on Thu 22 January 2009 in misc

I spent most of yesterday (and will spend today) operating in the Windows world. Every time I do this it reminds me of how much I hate it. Having to use IE certainly reminds me that Firefox is a much much better browser. I also miss having a comfortable editor or a powerful shell although I do note the DOS prompt has finally caught up with TAB completion for file paths. It still has nothing on a decent *nix command shell though.

The reason I'm putting myself through this is I'm tweaking a psychology experiment for Fliss' mum. The experiment itself is written in Python and commendably uses an Open Source framework called Vision Egg to generate and display the images. Unfortunately the experiment needs to run on some special graphics hardware which doesn't seem to have Python support (odd considering previous generations of hardware do seem to). The system however does supply examples in MATLAB, C++ Builder and a variety of .NET variants. So the choice was either to figure out how to drive the hardware from Python or convert the experiment to MATLAB (the only other tool the department has).

Fortunately Python's built in ctypes library makes interfacing to arbitrary libraries really easy. Once I'd dug out the C headers and loaded the DLL everything else was pretty mechanical. Today I just need to figure out the most expeditious way to thunk VisionEgg to VISAGE.

Python is fast becoming a favourite programming language of mine. I would probably still reach for Perl if the script involved much text grokking having invested so much time in learning it's regexp implementation. However for prototyping or extending a program through plugins Python makes much more sense. It seems remarkably consistent in it's behaviour and has yet to pull something unexpected on me. The interactivity of the shell/interpreter makes exploring approaches a lot easier than the multiple edit/save/run cycles of Perl.

I still miss having a decent editor though :-(