Python Setup Notes: Difference between revisions
No edit summary |
|||
| (7 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
== Python for S60 == | == Python for S60 == | ||
[http://wiki.opensource.nokia.com/projects/Python_for_S60 Python Home Page] | |||
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. | |||
=== Installation === | === Installation === | ||
[http:// | [http://wiki.opensource.nokia.com/projects/Installing_PyS60 Installing PyS60] | [http://sourceforge.net/project/showfiles.php?group_id=154155 Download page] | ||
[http://sourceforge.net/project/showfiles.php?group_id=154155 | |||
Since we are using the | Since we are using the N80 and N95 phones provided by Nokia which are Series 60 3rd Edition devices - we'll need to download the following files: | ||
[http://uberthings.com/teaching/mobile_application_design/9/ Grab the files here] | |||
Bluetooth | * Python | ||
* Python Script Shell | |||
* Documentation | |||
Bluetooth the first two to your N80 / N95 and install them ahead of time. | |||
=== Reference === | === Reference === | ||
[http://wiki.forum.nokia.com/index.php/Category:Python#.22How_To.22_Guides_for_Python Forum Nokia How To Guides for Python] | |||
[http://www.mobilenin.com/pys60/menu.htm Jurgen Scheible's Tutorial Site] | [http://www.mobilenin.com/pys60/menu.htm Jurgen Scheible's Tutorial Site] | ||
| Line 35: | Line 40: | ||
appuifw.note(u"Well hello Python for Series60, you look nice... ", "info") | appuifw.note(u"Well hello Python for Series60, you look nice... ", "info") | ||
</pre> | |||
==== Simple Text Input ==== | |||
<pre> | |||
# Copyright (c) 2005 Jurgen Scheible | |||
# This script performs a query with a single-field dialog (text input field) | |||
# and displays the users input as a pop-up note | |||
import appuifw | |||
firstname = appuifw.query(u"Type your first name:", "text") | |||
appuifw.note(u"Your first name is: " + firstname, "info") | |||
surname = appuifw.query(u"Type your surname", "text") | |||
appuifw.note(u"Your surname is: " + surname, "info") | |||
appuifw.note(u"Hola " + firstname + " " +surname, "info") | |||
# NOTE: a text string must be defined as unicode | |||
# u"..." | |||
# The mobile can not diplay the text otherwise properly! | |||
</pre> | </pre> | ||
| Line 40: | Line 72: | ||
# Rewrite the Zombie Detector from Week 2 in Python. | # Rewrite the Zombie Detector from Week 2 in Python. | ||
# Create a script which reads in a string and then sends it an SMS to your neighbour | # Create a script which reads in a string and then sends it an SMS to your neighbour | ||
Latest revision as of 14:09, 2 November 2007
Python for S60
Python Home Page 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.
Installation
Installing PyS60 | Download page
Since we are using the N80 and N95 phones provided by Nokia which are Series 60 3rd Edition devices - we'll need to download the following files:
- Python
- Python Script Shell
- Documentation
Bluetooth the first two to your N80 / N95 and install them ahead of time.
Reference
Forum Nokia How To Guides for Python
Jurgen Scheible's Tutorial Site
Guido Van Rossum's Python Tutorial
Editors
Useful Tools
Miso - a utility library Kari Pulli's Python page
Simple Programs
Hello Python
import appuifw appuifw.note(u"Well hello Python for Series60, you look nice... ", "info")
Simple Text Input
# Copyright (c) 2005 Jurgen Scheible # This script performs a query with a single-field dialog (text input field) # and displays the users input as a pop-up note import appuifw firstname = appuifw.query(u"Type your first name:", "text") appuifw.note(u"Your first name is: " + firstname, "info") surname = appuifw.query(u"Type your surname", "text") appuifw.note(u"Your surname is: " + surname, "info") appuifw.note(u"Hola " + firstname + " " +surname, "info") # NOTE: a text string must be defined as unicode # u"..." # The mobile can not diplay the text otherwise properly!
Exercises
- Rewrite the Zombie Detector from Week 2 in Python.
- Create a script which reads in a string and then sends it an SMS to your neighbour