This page was last modified 18:47, 3 March 2008.
Python
From Forum Nokia Wiki
Python is a programming language used in both computers and mobile phones that was created by Guido van Rossum and released in 1991. Programs written in Python have a script-like structure.
Python for S60 is the ported version of the original language to mobile phones. It allows programmers to control features like camera, messaging, Bluetooth etc. through the scripts they write. Python for S60 is a two-part suite made up of the PC editor and the on-phone interpreter.
The PC editor is similar to a classic text editor, albeit with programming-orientated options. It comes in command line and GUI versions. It is recommended that beginners use GUI as it is more similar to a traditional program editor/compiler and thus easier to learn on.
The command line version is slightly more abstract, as all actions are performed via keyboard.
Interestingly, almost any text editor can be used to create Python scripts. For example, a programmer can write the script in Notepad, save it as *.py and, if validly written, it can be interpreted. The advantage of a specialised editor is the ability to highlight key words and quickly check for syntax errors.
The phone part of the software is an interpreter. It reads the script run by the user and interprets it. It works on the same principle as a program compiler, in that it reads the program's instrucions and gives the appropriate output.
The syntax of the language is similar to that of C++. The same main data types (integer, long, boolean, float, string) are used, but Python is noticeably easier to learn at the beginning as it is partly automated (i.e. integer numbers are automatically promoted to larger values without the user's explicit instruction etc.).
Here is a very rudimentary example of a script that displays a message and a sum:
>>> print "5 plus 3 is %d" % (5+3)
5 plus 3 is 8
See also:
- Python for S60 in FN Wiki
- Python for S60 in opensource.nokia.com
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Python Beginner | tsftsf | Python | 4 | 2007-05-27 04:45 |
| [moved] How install Python enviroment for PC emulator | sujamuke | Python | 3 | 2008-08-14 17:56 |
| Help debugging Keypress module crashing with python 1.4.0 and 1.4.1 - S60v3 | xraimon | Python | 2 | 2007-10-18 00:02 |
| Accelerometer\Sensor apps for N95 - Java? Python? C++? | gillyd | General Discussion | 2 | 2008-01-08 04:50 |
| extending and embeding Python with C/C++ | nile_mail | Python | 7 | 2007-01-05 05:35 |
