Install the Files to the Phone
Open the received messages by selecting them in order. First, installthe PyS60 interpreter (PythonForS60) and then the user interface for the
PyS60 interpreter (PythonScriptShell). Follow the on-screen instructions
on the phone – for instance, select ‘Yes’ if a security warning appears
on the phone screen. If you are asked to install the files on the phone
memory (Ph. Mem) or the memory card (M. card), it is up to you which
one to choose.
After the installation is complete, your phone shows the Python icon
on the desktop or inside one of the desktop folders (Figure 2.1). Your
phone is now ready to execute Python scripts. Let’s prepare a ‘Hello
world’ script.
Writing and Running a Python Script
1. Write a Python ScriptYou can write a Python script on your computer with any text editor.
Useful editors for Windows are, for example, ConTEXT or PyWin which
are freely downloadable on the Internet, but Notepad also works. Possible
editors for Mac are, for example, SubEthaEdit, TextMate or BBEdit. We do
not recommend using Mac’s TextEdit application, as it might place some
invisible characters in your code which throw an error when executing
the script. In Linux, you can use Vim or Emacs.
No comments:
Post a Comment