Python in Your Pocket: Python for S60

Matt Croydon

Introduction

S60, formerly known as Series 60, is a smartphone platform built on top of Symbian OS.

Python allows developers to write useful applications with very few lines of code. Many standard libraries and APIs are available and virtually any C++ API can be wrapped in a Python extension. Because of this Python allows deeper access to phone features with less overhead than alternatives like J2ME or Symbian C++.

Getting Started

Check the technical device specifications for the correct version to download for your phone.

appuifw Examples

Hello World:

import appuifw
appuifw.note(u"Hello", 'info')

Input (simple popup):

name = appuifw.query(u'Enter your name', 'text')

PyS60 Advantages

Libraries

The entire Python Standard Library is not distributed with PyS60

Some highlights:

anydbm, math, md5, re, urllib, zlib

Many other pure-python libraries "just work" by copying the pure python libs (and any dependencies) from the python 2.2.2 source.

Some Available APIs

More Available APIs

Calendar API

Add, delete, modify:

now = time.time()
cal = calendar.open()
a = cal.add_appointment()
a.content = 'urgent meeting'
a.set_time(now, now) # start and end time
a.commit()

From Series 60 snippets

Third Party APIs

PDIS also has a S60 compatability library that uses wxPython to emulate appuifw. This library makes initial application development very easy because apps can be roughed out on a desktop machine without having to code, send to device, load, test.

Nick also has some awesome Python for Series 60 apps and hacks including NMEA Info and log location.

Pure Python Libraries

Many pure python libraries "just work" with either the core PyS60 distribution or with the addition of required libraries from the Python 2.2.2 source.

PyS60 Applications (1)

nmea_info - traffic cam - quotegrab

images/nmea_info.jpg images/traffic_cam1.jpg images/quotegrab3.jpg

PyS60 Applications (2)

dict2go - musician - dashboard

images/dict2go2.jpg images/musician1.jpg images/dashboard.gif

Distributing Applications

images/install.jpg

What a Difference a Year Makes

Since PyCon last year:

PyS60 Community

What Comes Next?

Note that apache + mod_python is an internal Nokia research product and is not available to the general public.

Questions - Slides

Questions?

Slides are available at

http://postneo.com/talks/pycon2006/

ReST source:

http://postneo.com/talks/pycon2006/presentation.txt