1. 简介

This tutorial gives you an introduction to Python for S60 to catch in an easy and quick way the "low hanging fruits" it offeres. No object oriented programming knowledge is needed here, even hardly any pre-knowledge of Python as a language. You will learn things as you go along here - by trying out working scripts on the phone to see what they do and then study them.

1.1. 在手机开发 S60 平台上的Python 程序

Development is simple and fast. In order to run a Python program of your Nokia S60 phone, all you have to do is to:

  1. Install the Python interpreter application as a *.sis file called "Python for Series 60" which you can download for free (check here for details)
  2. Write your python script with a simple editor on your Mac/PC, save it as a *.py file
  3. Push via Bluetooth or move via USB cable your *.py file to your phone and simply run it. No compile, no build process needed.

"Python for S60" is an ideal choice for starting to create applications for devices based on Series 60 Platform because it is easy and quick. It is well suited for the development of prototypes or for building applications to make proof of concept with a simple and consistent language. Only some knowledge on any scripting language is enough to understand the programming of python scripts and to create working applications in a very short time.

1.1.1. Python是什么?

  • Python is an Open Source programming language devloped by Guido van Rossum )
  • Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java. The popularity of Python is on the rise.
  • Python combines remarkable power with very clear syntax.
  • It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing.

1.1.2. Series 60 平台上的 Python

Python for Series 60 brings the Python programming language to the Series 60 Platform, Nokia's "modified/enhanced" version of the Symbian Operating System platform for Mobile devices. Currently Python for Series 60 is based on Python 2.2.2. It Supports many of the Python Standard Library modules but has on top a few mobile platform specific modules e.g.

  • native GUI widgets,
  • Bluetooth
  • GPRS networking
  • GSM Location information,
  • SMS Messaging,
  • Acces to camera and more!

1.1.3. 支持的移动设备

所有S60第二版和第三版的设备

到这里查看你的手机型号: Nokia S60 devices

1.1.4. Series 60 下Python的能力

  • GUI: Menu, Forms, Listboxes, Input fields, Dialogs, Notes
  • Graphics: - color, font and style attributes, - direct-screen drawing, - displaying images and icons
  • Key-down and key-up events
  • Sockets: TCP/IP, Bluetooth (RFCOMM, OBEX)
  • Messaging (SMS,MMS)
  • Networking (HTTP, FTP, …)
  • Acess to file system, file reading, XML, RSS
  • Acess to camera with viewfinder, telephone
  • Acess to calendar, contacts, sysinfo
  • Location (cell-id)
  • Content handler
  • Python extensions can be written in C++
  • Make standalone applications

1.2. 其他有用的站点