Install a Python Script on a Phone
You send a Python script to the phone in the same way that you sent theinstallation files in Section 2.2.3.
Open the received hello.py file in the message inbox by selecting it.
The message inbox handler will recognize it as a PyS60 file and display
a popup note. When asked to install your file as a ‘Python script’ or a
‘Python lib module’ (Figure 2.10), choose ‘Python script’. Your Python
script is automatically installed to the correct place. Now you can test the
script.
Test a Python Script
Start the PyS60 interpreter by clicking on the Python icon (Figure 2.1)on the desktop or inside the appropriate subfolder on your phone. Once
the PyS60 interpreter has started up, select ‘Options’ (Figure 2.4(a)) and
‘Run script’ (Figure 2.4(b)). Choose your script name, hello.py, from
the list and select ‘OK’. Your script should now start up and you should
see a green line stating Hello world! (Figure 2.5).
Congratulations! You have successfully written and executed your
script with PyS60! To go through all the examples in the book, just repeat
steps 1–3 for each new script. Have fun with it!
No comments:
Post a Comment