Python for S60-details about mobile development applications

Source: Internet
Author: User

On various forums, you can see the figure about Pythonfor s60 on a mobile phone. This article introduces Python for s60-details about developing applications on a mobile phone, I hope you will gain some benefits after reading this article. The following describes the content of this article.

Recently, we have seen python on the Forum. The cainiao are even more confused about what it means. So, what is the secret of Pythonfor s60, what is the magic of him? Because I have a certain understanding of this content,

I. Development Environment Introduction and Installation

There are three other programs in the development environment: Python for s60, PythonScriptShell, and ped. Python for s60 is the running environment of a program, which is equivalent to a java Virtual Machine. PythonScriptShell is a shell program and is mainly responsible for machine interaction, send the content entered by the user to the kernel for execution and feedback the execution result to the user. Ped is a python integrated development environment developed in the python language in the python IDE environment !!) The subsequent python scripts are mainly written and run on this page.

The installation process is relatively simple. First, run python for s60. Do not be surprised if no program icon is found after installation, because as a running environment, it cannot directly interact with people, therefore, there will be no icon for you to run. Then install PythonScriptShell and finally install ped. The entire development environment is installed. Note: Some people will say that python for s60 and the corresponding python application such as ped must be installed on the C drive. Otherwise, we only need to install python for s60 and the corresponding python application under the same drive letter. for example, install python for s60 to drive C, and install python applications to drive C, you can also install it on the e-drive. If you are prompted that the certificate has expired, set the phone time to six months before it expires)

2. Familiar with the python Development Environment

First open python, click the option -- runscript. The program has several built-in demo applets. You can try to run them. After running windows, you may find that it only provides the script execution function, neither writing scripts nor returning error messages to wrong scripts. If you really want to get rid of your computer, you need to use ped to write scripts on your mobile phone. Open the software, click the option -- file-new -- python to create a blank python script file, where you can compile the script program.

Sometimes we may want to test the effect of a script, or we want to merge a whole script into a single run.) We can use the python shell mode, open option-python shell to enter the python shell mode. Basically, the above content is used for writing scripts, which are not described in the script writing process. Note: If you are not familiar with the environment, do not change the content in settings. Otherwise, the program may fail to be executed)
Due to the special character encoding in the symbian system, some scripts with identical characters may have different codes. If the script with such characters is executed on the mobile phone, it may have unexpected results, therefore, users with other input methods must switch the Input Method to the built-in input method, and enter special characters in the abc state)

3. Prepare a python script on the mobile phone

First, write the simplest hello world script:
Create a blank python script file input:

 
 
  1. print"hello" 

Create a single input zone dialog box:

 
 
  1. appuifw.query()  
  2. appuifw.query(label,type)  

Create text: click "run". Note: in python, the method used to determine whether a statement is different from the C language. The C language is the same as that used to determine whether a ";" exists. python checks whether a script has a line break. If it is a line feed, it is considered to be a two-sentence. Therefore, there is no ";" at the end of each sentence in python.

2) create a graphical hello world script:

 
 
  1. import appuifw  
  2. appuifw.note(u"hello","info")  

Run,
Appuifw is an API function library provided by symbian. It mainly contains some input and output functions. import appuifw indicates that the appuifw library function is used in subsequent scripts, appuifw. note (u "******", "info") is displayed in the message Prompt window. The asterisk indicates the content you want to output.
 

 
 
  1. appuifw.query(u"what is your name", "text")  

Number

 
 
  1. appuifw.query(u"Typing your number:", "number")  

The above article describes Pythonfor s60 in detail.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.