Installing Python onto a Symbian-powered mobile phone
One of my aims for this year is to learn the Python programming language. Why? Well it seems to be cropping up all over the place. If you own a Linux machine or an Apple Mac, chances are it is already installed. Google recently made it the primary language for their AppEngine platform. The design ethos behind it is very appealing, a down to business approach to programming that dispenses with needing lots and lots of code and allows the developer to ulitlise powerful libraries to get the job done. Python code can be run on many different devices, and it is possible to use it to develop desktop, server and web applications. Now it can also be used to develop applications for mobile phones. This is very appealing to me as a developer as it takes time to master a new skill and I would rather that skill provides a lot of flexibility and the chance to get involved in a wide variety of challenges.
If you have a Symbian powered mobile phone you should be able to get a Python interpreter up and running on it and then you can start developing scripts that make use of your mobile phone's capabilities, something you would have needed C++ or Java skills for in the past. I found a good guide to installing it at: http://wiki.opensource.nokia.com/projects/Installing_PyS60 and here I'll explain how I got it installed using Kubuntu, this might not work for you so I would recommend you read the guide above first and only proceed on the understanding that this is at your own risk.
I did this with a Nokia 6120 Classic phone running Symbian S60 3rd Edition. Firstly check that the MicroSD card is in place in the phone. We will use this to transfer the software on the phone and store Python scripts. Plug the phone into your computer using the supplied USB cable. The phone will ask you what mode you want it to be in for the connection, select "Data transfer" and Ubuntu will pick up the memory card in your phone as a USB memory stick. Now we must download the files to install Python on your phone, this means downloading two files PythonForS60 and PythonScriptShell. You can get these files from SourceForge at: http://sourceforge.net/project/showfiles.php?group_id=154155 and you will need to select the lastest version and the version applicable to your phone. These will be "SIS" files, so for my phone I downloaded PythonForS60_1_4_3rdEd.SIS and PythonScriptShell_1_4_3_3rdEd.SIS. Save these files directly onto the mounted memory card of your phone. Now you can disconnect the phone from your computer.
To install the applications go to the File Manager (apparently this only works for 3rd Edition, so for other cases consult the Nokia installation guide above) by pressing the Menu button then navigating though "settings" -> "data mgr." -> "file mgr", press the "right" key to see the card and navigate to where you downloaded the Python files. Install them by pressing the centre button. Once installed you should Python (version 2.2.2) on your phone under Menu -> "My Own" -> "Python", if you start it you can get the option to run a script or the interactive console by pressing the left option key, included also are some sample scripts.
You can also drop Python scripts onto the memory card too and run them on your phone, in the documentation you will see mention of files being on the "C" and "E" drives, this doesn't mean your computer, this actually refers to the phone, the "C" drive is internal memory, the "E" drive the MicroSD card. Create a directory called "Python" on your MicroSD card and copy the Python scripts you want to run on the phone into there. The Python installation on the phone will be able to see these scripts and will prefix the location with an "e:" to show their location. I found many example scripts at: http://www.mobilenin.com/pys60/menu.htm (despite the pointing man picture) and these show how you can utilise the features of the phone without having to write lots and lots of code. One issue I did have though (and I don't know if this is just a coincidence) is when I first tried to run a script for text to speech I got no audio and the the phone had to be turned off and on again (yes I am an IT professional!) to restore it. After that the script worked perfectly.
I haven't had the chance yet to explore this technology fully on the Symbian platform, but it looks life it should be possible to develop powerful applications using Python and possibly reuse code from all of the other places that Python runs.
Trackback URL for this post:
- Liam Green-Hughes's blog
- 2461 reads





















Comments
Post new comment