Experiments in Python - the new OPL?

Published by at

OPL, if you remember, was the 'edit and run it on the device' programming system for old Psions and UIQ/Series 80 smartphones, but OPL never made it past Symbian OS 7. With the steadily increasing maturity of Python (there's a new version 1.3.14 out now), I've been playing with my Musician mini-app again. Read on for thoughts and the download...

Python has taken a while to get established for S60 3rd Edition, but it's almost there now, just a few more bugs for the Nokia team to fix. The wait has at least meant that goodies such as OpenGL support have been able to be built-in(!).

Now, if you've been following the whole Symbian Signed saga (whether as arch-villain or saviour), you'll know that getting applications - even trivial ones - compiled to be handled by the standard SIS/SISX mechanism isn't trivial and is, to be honest, a bit of a hassle. Doubly so when an interpreter like Python is used, as this has to have its own SIS file (or files in this case, as there are two of them), in addition to packaging up your own program.

Now, for commercial applications (are there any yet that use Python?), you'll want your own application icon, plus the one-click installation of a standard SIS file - certainly the major download sites will probably insist on this.

But, provided we're just talking about creating something for your own use and to share with others, the beauty of OPL (in the good old days) was that your program was just plain text (plus a few images, etc) and this elegance meant that you could edit or tweak it on the device itself, if all else failed. You typically didn't really care about an icon, running it from (in the Psion 3's case) a 'RunOPL' list was quite sufficient - just as long as the program worked.

Given that Python applications need the extra complexity of a Python install anyway, it doesn't seem a great loss to simply say 'Why not simply run programs from Python itself?'. There would be none of the hassle of packaging and self-certifying your application, and any Symbian Signed issues are taken care of because the Python interpreter itself is already signed and enabled for most common operations - you simply have to write the code to kick the different functions off.

MusicianIn the spirit of all this, I've been tinkering with my freeware Musician code (metronome, tuning, mini-piano) and have supplied it as files to be copied directly onto a user's expansion card, from where Python itself will find it.

You'll find Musician 2.0 for S60 3rd Edition here. Comments welcome on the method of distribution and on the code itself - I'm no Python wizard, so be gentle with me and send in any improvements you can make to the code!

Could Python be the new OPL? It's true that there's more of a learning curve, but the rewards are greater as you can do a lot more (current Python beta not withstanding)....

Over to you! And, if you use Musician yourself, rock on!!

Steve Litchfield, 1 Dec 2006