Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of developing applications on Python for S60 mobile phones?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "what is the method of developing applications on Python for S60 mobile phones". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

I. introduction and installation of the development environment

There are three programs in the development environment, which are Python for S60, PythonScriptShell and ped. Python for S60 is the running environment of the program, which is equivalent to the virtual machine of java. PythonScriptShell is a shell program, which is mainly responsible for computer interaction, sends the user input to the kernel execution and feeds back the execution result to the user. And ped is the python IDE environment (python integrated development environment developed in Python language, which is a bit roundabout! ) our future python scripts will mainly be written and run on this.

The installation process is relatively simple, first run python for S60, if you do not find the program icon after the installation, please do not be surprised, because as the program running environment, it can not directly interact with people, so there will not be an icon for you to run. Then install PythonScriptShell,*** install ped, and the entire development environment is installed. Note: when installing here, some people will say that it is necessary to install python for S60 and corresponding python applications (such as ped) to disk C. in fact, we only need to install python for S60 and corresponding python applications to the same drive letter, such as python for S60 to disk C, python applications also need to be installed to disk C, and similarly, you can install to disk E (if prompted to expire the certificate, please adjust the phone time half a year ago)

Second, familiar with the python development environment

First open python, click the option-runscript, the program built-in several demo Mini Program, you can try to run. After running, some windows may become old birds and may find that it only provides the ability to execute scripts, can neither write scripts nor return error messages to wrong scripts. If you want to really get away from the computer and write scripts on your phone, you need to use ped. Open the software and click the option-file-new--python to create a blank python script file where you can write scripts.

Sometimes we may want to test the effectiveness of a script, or we may want to run an entire script sentence by sentence (similar to stepping). We can use python shell mode and turn on the option-python shell to enter python shell mode. Basically writing a script is applied to the above, and what is not introduced is introduced in the scripting process. (note: for readers who are not familiar with this environment, please try not to change the content in settings, otherwise the program may not be executed properly.)

(because the character encoding in the symbian system is quite special, some characters that look exactly the same may have different encodings, and if the script containing this character is executed on the mobile phone, it may have unexpected effects, so users with other input methods must switch the input method to the input method that comes with the system, and the special characters must be entered in abc.)

III. Preliminary preparation of python script on mobile phone

First, let's write the simplest hello world script:

Create a blank python script file for input:

Print "hello"

Create a single input area dialog box:

Appuifw.query () appuifw.query (label,type)

Create text: then click the option-- run, note: the method of judging whether a sentence is a paragraph in python is different from that in c language, which is used to determine whether there is a ";", while python is to see whether a script wraps a line, and if it breaks, it is recognized as two sentences, so there is no ";" at the end of each sentence in python.

(2) create a hello world script with a graphical interface:

Import appuifw appuifw.note (u "hello", "info")

Carry out

Appuifw is an API function library provided by symbian, which mainly contains some input and output functions, while import appuifw explains that the functions in the appuifw library are used in subsequent scripts. The effect of appuifw.note (u "*", "info") is to pop up an information prompt window with an asterisk for the content you want to output.

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

Figures

This is the end of the content of appuifw.query (u "Typing your number:", "number") "what is the method of developing applications on Python for S60 mobile phones". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report