Python for S60
From OpenSource
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 garage.maemo.org or use community managed Python for Series 60 community edition which comes with some extra goodies for low level hackers.
...and what it is really about is making it not only possible but also easy and fun to hack these wonderful gadgets.
Contents |
Latest news
- March 24, 2009: Python for S60 1.9.3 has been officially released.
- NEW: Python core is upgraded to 2.5.4
- NEW: Touch event support (comes with the scribble sample application)
- NEW: sciptext module for using S60 Platform Service APIs
- Easier runtime deployment
- NEW: SSL support for sockets
- Release notes: https://garage.maemo.org/frs/download.php/5524/release_notes_1.9.3.txt
- February 24, 2009: Python for S60 1.9.2 has been officially released.
- NEW: Sensor module support
- Reduction in the installer size
- Release notes: https://garage.maemo.org/frs/download.php/5523/release_notes_1.9.2.txt
- January 24, 2009: Python for S60 1.9.1 has been officially released.
- Better interpreter startup and sis installation time than in 1.9.0
- Release notes: https://garage.maemo.org/frs/download.php/5322/release_notes_1.9.1.txt
- December 24, 2008: Python for S60 1.9.0 has been officially released.
- Project is now hosted here: https://garage.maemo.org/projects/pys60
- NEW: Python 2.5.1 core.
- NEW: A GUI version of Ensymble for packaging scripts into sis files.
- NEW: More extensive documentation in the form of HTML documents.
- NEW: If the application raises an exception on start-up, the traceback is printed on the screen instead of the application quitting silently.
- Caution : S60 2nd Edition no longer supported !!! So use 1.4.5 for 2nd edition.
- December 3, 2008: Python for S60 1.4.5 has been officially released.
- NEW: Added the possibility to run Python code in threads that weren't started by Python itself, by adding the functions InitializeForeignThread() and FinalizeForeignThread() to the CSPyInterpreter class. For details see the section "Python/C API Extensions" of the API reference.
- NEW: Added timeout support to globalui module.
- NEW: The positioning module has been made safe to use from several threads.
- NEW: Support for the "description" field has been added to the calendar module.
- See PyS60 history
Documentation
Official documentation is available as downloadable PDF.
PyS60 documentation page contains links to various other resources.
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.
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.
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.
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.
- Build process explained for user distributable PyS60 SIS files
- Guide for creating a standalone app
- More links to creating a standalone app
- Creating standalone apps in 3rd ed
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 extensions see PyS60 extensions creation using Carbide.
Compiling PyS60
So you want to "roll your own" PyS60 interpreter from source? Okay then, check out Compiling PyS60.
Bugs and features
To report bugs and suggest new features in PyS60 distribution, use the SourceForge bug and feature request trackers.
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 !
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
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.