Python Setup Notes: Difference between revisions

From Mobile Application Design
Jump to navigationJump to search
 
(4 intermediate revisions by the same user 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.


[http://wiki.opensource.nokia.com/projects/Python_for_S60 Python Home Page]
     
=== Installation ===
=== Installation ===
[http://wiki.opensource.nokia.com/projects/Installing_PyS60 Installing PyS60] |  
[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&package_id=171153&release_id=462564 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:


Since we are using the lovely N80 phones provided by Nokia - we'll need to download the following files:
[http://uberthings.com/teaching/mobile_application_design/9/ Grab the files here]


*[http://downloads.sourceforge.net/pys60/PythonForS60_1_3_13_SDK_3rdEd_selfsigned.zip?modtime=1163177758&big_mirror=0 PythonForS60_1_3_13_SDK_3rdEd for Series60 3rd Edition] phones like N80, N91, N93.
* Python
*[http://downloads.sourceforge.net/pys60/pythonscriptshell_1_3_13_3rded_selfsigned.SIS?modtime=1163177763&big_mirror=0 PythonScriptShell_1_3_13_3rdEd]
* Python Script Shell
*[http://downloads.sourceforge.net/pys60/PythonForS60_doc_1_3_13.pdf?modtime=1163177758&big_mirror=0 API Documentation]
* Documentation


Bluetooth these to your N80 and install them ahead of time.
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 38: 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>



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:

Grab the files here

  • 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

Python Library Reference

Guido Van Rossum's Python Tutorial

Editors

PyDev (for Eclipse

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

  1. Rewrite the Zombie Detector from Week 2 in Python.
  2. Create a script which reads in a string and then sends it an SMS to your neighbour