Learning Python, my first steps

In yesterday's post, I advertised PsychoPy as an interesting alternative for the PsychToolbox, which runs on Matlab. In my work as a PhD student, I program my experiments in C# and OpenGL, using libraries that were written by my supervisor and our technician. However, I can't share any of my work with the community, which is something I'm quite keen on. Furthermore, my experiments will only run on Windows. So I think PsychoPy is interesting because it is free and platform independent but to get the best from PsychoPy, you need to know a thing or two about the Python programming language. So yesterday, I stepped into the world of Python development.

First impressions; not bad. It took me some time to find a good IDE for the Mac and to find out how to get additional libraries (and got stuck in getting rpy running). In the end I got everything up and running; I'm using IDLE for now and I've installed SciPy, NumPy, wxPython, PyGame and PyOpenGL. At this point I should mention that Jon has done a great job in creating a custom IDE that is included in the PsychoPy package, or at least it is on the mac version, and you can easily code and run your experiments in this environment. Furthermore, all the packages you would need for experiments are included in the package. But... I'm stubborn and like to take the hard route; if you want to get a kickstart, use Jon's IDE.

The Python language seems - at a first glance - great. It seems elegant and I've had no trouble understanding code sniplets. It handles strings much much better than matlab, and it looks like whatever you can do with Matlab, you can do with Python too (using NumPy and SciPy). I'm now working my way through some Python books to get the hang of the basics - will keep you updated.

Leave a Reply

You must be logged in to post a comment.