Python for S60

From OpenSource

Jump to: navigation, search

Python for S60 is Nokia's port of the Python language to the S60 smartphone platform. In addition to the standard features of the Python language, PyS60 provides access to many of the phone's uniquely smartphone-y functions, such as camera, contacts, calendar, audio recording and playing, TCP/IP and Bluetooth communications and simple telephony.

It's open source, under Apache 2 and Python licenses. You can download the source for the latest release from SourceForge.

...and what it is really about is making it not only possible but also easy and fun to hack these wonderful gadgets.

Contents

[edit] Latest news

  • 21 January 2008 : Python for S60 1.4.2 FINAL has been released !
    • NEW : phone's log module has been added : SMS , received calls etc.
    • Localised vendor ID and unique vendor ID have been set to "Nokia" in the SIS packages for 3rd edition. As a result, you may need to uninstall the previous version before installing this one.
    • bug fix : wrong time returned for inbox messages
    • bug fix : positioning.select_module() crashes python
    • bug fix : calendar find_instances fails for long searchstrings
    • bug fix : e32.ao_callgate(not_a_callable) fails to set an exce
    • bug fix : Code in appuifwmodule.cpp prevents use of SVG icons
    • bug fix : Incomplete Documentation for 1.4.1 Video APIs
    • bug fix : Missing 00000000.rss file in template dir
    • bug fix : import telephone causes an error
    • bug fix : e32db format_time broken in some localisations
    • bug fix : ViewSrv 9 panic while exiting previously backgrounde
    • bug fix : start_server does not report error for unknown file
    • bug fix : Incomplete documentation for Contact object
    • bug fix : Adding Icon with out-of-range index to Listbox


[edit] Documentation

Official documentation is available as downloadable PDF.

PyS60 documentation page contains links to various other resources.

[edit] Installation

See Installing PyS60. Which package to get, how to push scripts to the phone, using the Bluetooth console etc. This is a good place to start your Python on S60 journey.

[edit] Applications

See PyS60 applications. Also, grabbing the package source is useful, as there are some interesting sample apps embedded in the source tree. And you are making an OSS statement by downloading source ;) If you are a novice trying to figure out how to write your first program on a mobile phone then click novice howto.

[edit] Test and debugging

PUTools is a Python shell over Bluetooth with ability sync files between PC (development environment) and target device (phone). You can deploy and test new Python code in the target device with few clicks.

Battery consumption is very important aspect in embedded development. See PyS60 energy profiling info.

Short debugging tutorial.

[edit] Python Debugger - pdb

It is also possible, since some may wish to develop on a GNU/Linux platform, to install the standard Python Debugger pdb to the PyS60 environment. Effective use of this is documented in wiki.research.nokia.com/images/c/cf/Programming_with_Python.pdf

  • Download python 2.2.2's tgz file from www.python.org/download/releases/2.2.2/
  • Extract the file using tar -zxvf <filename>
  • Send via bluetooth to your phone, the following files:
    • Python-2.2.2/Lib/pdb.py
    • Python-2.2.2/Lib/cmd.py
    • Python-2.2.2/Lib/bdb.py
  • When the phone prompts you, choose to install each of the files as libraries

[edit] Creating Standalone Applications

Python has all the advantages of an interpreted language, but you can create standalone applications for the S60 platform. Here are some links.

[edit] Extension modules

Python for S60 support most of the standard Python 2.2 modules, but to cut down download size all modules are not included in Nokia's distribution. You can simply copy missing .py files from Python 2.2 Windows version to your application. Some standard modules have been modified to be more suitable for mobile phones, see: PyS60 python modules.

Python for S60 supports the Python/C API so you can create your own native C++ extension modules (.PYD's) to extend the functionality of your application. This means that all the native Symbian features are available to your Python code as well. For a list of native extension modules that are available see: PyS60 extensions. For creating your exenstions see PyS60 extensions creation using Carbide.

[edit] Compiling PyS60

So you want to "roll your own" PyS60 interpreter from source? Okay then, check out Compiling PyS60.

[edit] Bugs and features

To report bugs and suggest new features in PyS60 distribution, use the SourceForge bug and feature request trackers.

[edit] Getting help

The Python for S60 discussion board at Forum Nokia is THE place for chatting about Python for S60 related matters. The archives of the board may already contain the answer you are looking for. Try the search function before asking and you may save lots of time.

For more informal discussions, try the PyS60 IRC channel.

Oh, and did you look at the extensive documentation ? it's tasty and nutritious !

[edit] Other information sources

  • The new Forum Nokia Wiki provide many code examples and how to guide (from beginner to the geek !)
  • The old unofficial PyS60 wiki at postneo.com is deprecated in favor of this one (and unfortunately wikispammed). Big thanks to Matt Croydon for providing that wiki space!
  • Py4S60: a new unofficial Google Group for newbies and developers.
  • Python S60 : another new unofficial Google Group for developers
  • PyS60 (Portuguese - Brazil): A tutorial in portuguese about PyS60.
  • Others links

[edit] You think something else should be here ?

  • Go ahead and add it! I've been adding scraps to the wiki rather than keeping private notes - you can do the same.
  • You're welcome to edit any page on this Wiki and insert relevant info. People will help with formatting if the info is good. Note: Only front page material should go on this front page.
  • You can put a request for an addition HERE by editing this section.
Personal tools
MediaWiki Resources