Freesteel Blog » Python Cross Platform

Python Cross Platform

Wednesday, November 15th, 2006 at 4:17 pm Written by:

Python programmes can be for mulltiple platforms. If you can get away with not using platform specific packages in theory at least you should be able to run one python script on several different operating systems with the same look and feel.
I recently (last week Friday 10-11-2006) had the pleasure to put this to the test once again: I was asked to programme a psychology experiment where the person experimented on is exposed to a series of 3 letter sylabels on the screen, one of which is red. They have to press a corresponding key and time as well as the correctness of the answer is saved to a file for later statistical analysis. I programmed this in python and used Python Imaging Library and wxwidgets for the graphics and the user interfacey bits. All done on windows xp, and it works fine. Now, making a Mac version should be very easy: you should be able to take the code and run it on the Mac. Some hours later, compiling all sorts of stuff to be able to read and render font files on the Mac, work around the fact that a Mac keyboard has a different layout than a PC keyboard… In short, you still have to do platform specific programming; and the biggest annoyance is that there does not seem to be a very simple sound interface to just do a beep on the Mac. Do I really have to read and play back a wave file to just sound an acoustic warning? And, I have the suspicion that keyboard events are buffered differently on the Mac version of wx than the PC version. This is critical, because i have to filter out multiple key strokes, when the tested person goes maybe into ‘computer game’ mode and starts hammering one key…

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>