- 浏览: 1010369 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (367)
- JavaScript (23)
- Java (60)
- Python (41)
- 其他 (36)
- SQL (4)
- 开发工具 (26)
- Linux (15)
- AJAX (6)
- Cache (3)
- 正则 (4)
- 架构 (9)
- 手机 (3)
- MySQL (4)
- Android (115)
- vps (1)
- 网站 (4)
- scale (3)
- 搜索引擎 (3)
- iPhone (2)
- hessian (1)
- hessdroid (1)
- 411 (1)
- jstat (1)
- gc (1)
- gallery (1)
- 惯性 (1)
- eclipse (1)
- mac wget error (1)
- miui file explorer 无用 解决办法 (1)
- vim (1)
最新评论
-
qingyezhangluo:
哎。楼主您既然是分享代码的为什么要加密的呢?而且问你密码还不回 ...
android应用换皮肤(转) -
MagicError:
kavoe 写道下载文件有密码。。。。
http抓包工具 -
knightdf:
我先试下再来
JAVA的RAS加密例子 -
kavoe:
下载文件有密码。。。。
http抓包工具 -
changanfounder:
hmc1985 写道setCallbackDuringFlin ...
android gallery滑动惯性问题
信息: 如何创建一个应用程序? 9个步骤
- 插入所有需要的模块
- 设定屏幕大小 (normal, large, full)
- 编写你程序的逻辑代码
- 创建一个程序菜单(如果有必要)
- 设定一个离开的按键
- 设定程序标题
- 如果有必要,分配活动的对象
- 设定程序主题(文字,背景,列表或什么都没有)
- 创建一个恰当的主循环体
-
如何装如所需要的所有模块?
- import appuifw
- import e32
-
如何设定屏幕大小?
- # screen has 3 different values:
- appuifw.app.screen='normal' #(a normal screen with title pane and softkeys)
- appuifw.app.screen='large' #(only softkeys visible)
-
appuifw.app.screen='full' #(a full screen)
示例代码:
-----------------------------------------
import appuifw
import e32
def exit_key_handler():
app_lock.signal()
round = appuifw.Text()
round.set(u'hello')
# put the application screen size to full screen
appuifw.app.screen='full' #(a full screen)
# other options:
#appuifw.app.screen='normal' #(a normal screen with title pane and softkeys)
#appuifw.app.screen='large' #(only softkeys visible)
app_lock = e32.Ao_lock()
appuifw.app.body = round
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
----------------------------------- -
如何创建你程序的逻辑结构?
这个完整的指南就是关于这个问题的…… 你必须确定一些逻辑结构使你的程序运行起来,任何逻辑结构都有可能! -
如何创建一个应用程序菜单?
一个应用程序菜单使用左边的软按键并使得在你的应用程序运行时总是更够被使用。一个应用程序菜单也能包含子菜单。- # create the callback functions that shall be executed when when selecting an item in
- # the menu:
- def item1():
- print "item one"
- def subitem1():
- print "subitem one"
- def subitem2():
- print "subitem two"
- # create the menu using appuifw.app.menu[(title, callback1), (title, (subtitle, callback2))]
- appuifw.app.menu = [(u"item 1", item1), (u"Submenu 1", ((u"sub item 1"
- , subitem1),(u"sub item 2", subitem2)))]
示例代码:
----------------------------------------
import appuifw
import e32
def exit_key_handler():
app_lock.signal()
# create the callback functions for the application menu and its submenus
def item1():
print ""
round.set(u'item one was selected')
def subitem1():
print ""
round.set(u'subitem one was selected')
def subitem2():
round.set(u'subitem two was selected')
app_lock = e32.Ao_lock()
round = appuifw.Text()
round.set(u'press options')
appuifw.app.screen='large'
appuifw.app.body = round
# create the application menu including submenus
appuifw.app.menu = [(u"item 1", item1),
(u"Submenu 1", ((u"sub item 1", subitem1),
(u"sub item 2", subitem2)))]
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
--------------------------------------------- -
如何设定一个离开程序的键盘操作?
当你按下右键(即离开)时,离开的操作就会被执行。使用特别定义的一个函数,你就能定义在按下键时要做什么。- def quit():
- appuifw.app.set_exit()
- app.exit_key_handler=quit
-
如何设定程序名称(标题)?
- appuifw.app.title = u"SMS sending"
-
如果有必要,如何来分配有效的对象?
A facility called active object is used extensively on the Symbian OS to implement co-operative, non-preemptive scheduling within operating system threads. Preserving the responsiveness of the UI can be done with the help of active objects. This needs to be considered when designing the application logic. As a Python programmer, you typically need to take care of active objects as they relate to UI programming, and sockets. Can be tricky!- # You need to import the e32 module
- import e32
- # create an instance of the active object
- app_lock = e32.Ao_lock()
- # starts a scheduler -> the script processes events (e.g. from the UI) until lock.signal() is
- # callled.
- app_lock.wait()
- # stops the scheduler
- app_lock.signal()
更详细的内容请查阅 API_Reference_for_Python.pdf 文档。
-
如何设置程序主体?
- # body as Listbox:
- appuifw.app.body = appuifw
- .Listbox(entries,shout)
示例代码:
------------------------------------------------
import appuifw
import e32
def exit_key_handler():
app_lock.signal()
# define a callback function
def shout():
index = lb.current()
print index
print entries[index]
# create your content list of your listbox including the icons to be used for each entry
entries = [u"Signal",u"Battery"]
lb = appuifw.Listbox(entries,shout)
# create an Active Object
app_lock = e32.Ao_lock()
# create an instance of appuifw.Listbox(), include the content list "entries" and the callback function "shout"
# and set the instance of Listbox now as the application body
appuifw.app.body = lb
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
--------------------------------------- # body as Text:
- appuifw.app.body = appuifw.Text(u'hello')
示例代码:
------------------------------------
import appuifw
import e32
def exit_key_handler():
app_lock.signal()
# create an instance of appuifw.Text()
round = appuifw.Text()
# change the style of the text
round.style = appuifw.STYLE_UNDERLINE
# set the text to 'hello'
round.set(u'hello')
# put the screen size to full screen
appuifw.app.screen='full'
# create an Active Object
app_lock = e32.Ao_lock()
# set the application body to Text
# by handing over "round" which is an instance of appuifw.Text() as definded above
appuifw.app.body = round
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
---------------------------------------------- # body as Canvas:
- appuifw.app.body=appuifw.Canvas(event_callback=None, redraw_callback=handle_redraw)
示例代码:
---------------------------------------------
# Copyright (c) 2005 Jurgen Scheible
# This script draws different shapes and text to the canvas
import appuifw
from appuifw import *
import e32
# import graphics
from graphics import *
# create an exit handler
def quit():
global running
running=0
appuifw.app.set_exit()
# set the screen size to large
appuifw.app.screen='large'
# define an initial image (white)
img=Image.new((176,208))
# add different shapes and text to the image
# coord. sequence x1,x2,y1,y2
img.line((20,20,20,120),0xff00ee)
img.rectangle((40,60,50,80),0xff0000)
img.point((50.,150.),0xff0000,width=40)
img.ellipse((100,150,150,180),0x0000ff)
img.text((100,80), u'hello')
# define your redraw function (that redraws the picture on and on)
# in this case we redraw the image named img using the blit function
def handle_redraw(rect):
canvas.blit(img)
running=1
# define the canvas, include the redraw callback function
canvas=appuifw.Canvas(event_callback=None, redraw_callback=handle_redraw)
# set the app.body to canvas
appuifw.app.body=canvas
app.exit_key_handler=quit
# create a loop to redraw the the screen again and again until the exit button is pressed
while running:
# redraw the screen
handle_redraw(())
# yield needs to be here in order that key pressings can be noticed
e32.ao_yield()
------------------------------------------------
9. 如何创建一个主循环?
把主循环放置在需要反复运行的代码位置
1. running = 1
2. while running:
3. # #e.g. redraw the screen:
4. handle_redraw(())这里有2个我常用的程序骨架示例
- no main loop because the application logic works without示例代码:
---------------------------------
# Copyright (c) 2006 Jurgen Scheible
# Application skeleton (no main loop)
import appuifw
import e32
appuifw.app.screen='large'
# create your application logic ...
def item1():
print "hello"
def subitem1():
print "aha"
def subitem2():
print "good"
appuifw.app.menu = [(u"item 1", item1),
(u"Submenu 1", ((u"sub item 1", subitem1),
(u"sub item 2", subitem2)))]
def exit_key_handler():
app_lock.signal()
appuifw.app.title = u"drawing"
app_lock = e32.Ao_lock()
appuifw.app.body = ...
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
""" description:
# 1. import all modules needed
import appuifw
import e32
# 2. set the screen size to large
appuifw.app.screen='large'
# 3. create your application logic ...
# e.g. create all your definitions (functions) or classes and build instances of them or call them etc.
# ...... application logic ....
# 4. create the application menu including submenus
# create the callback functions for the application menu and its submenus
def item1():
print ""
round.set(u'item one was selected')
def item1():
print "hello"
def subitem1():
print "aha"
def subitem2():
print "good"
appuifw.app.menu = [(u"item 1", item1),
(u"Submenu 1", ((u"sub item 1", subitem1),
(u"sub item 2", subitem2)))]
# 5. create and set an exit key handler
def exit_key_handler():
app_lock.signal()
# 6. set the application title
appuifw.app.title = u"drawing"
# 7. crate an active objects
app_lock = e32.Ao_lock()
# 8. set the application body
appuifw.app.body = ...
# no main loop
appuifw.app.exit_key_handler = exit_key_handler
app_lock.wait()
"""
----------------------------------
2. with mainloop (if suitable)
发表评论
-
python图形处理库Python Imaging Library (PIL)简介及安装(转载收藏)
2010-10-14 13:02 2103[简介] 这两天用python写一个程序,需要对各种格式的 ... -
python:在python中使用opencv进行摄像头编程初体验
2009-12-02 13:11 3960闲着没事做,前段时间买了个摄像头,在ubuntu上用。打开ch ... -
python使用tuple作参数
2009-08-07 15:53 3625def a(*aa): print aa[0] ... -
python sort key
2009-08-07 13:18 2466>>> a=range(10) >&g ... -
python 自带小爬虫
2009-08-07 10:28 1959#! /usr/bin/env python “”" ... -
Python支持中文
2009-08-07 10:27 3230让Python支持中文要在Python代码头部加上# -* ... -
Python多线程 简明例子
2009-08-07 10:27 3049综述 多线程是 ... -
Python多线程编程
2009-08-07 10:26 4067我们在做软件开发的时 ... -
python循环采集
2009-08-07 10:26 1606html=”<td>1</td>< ... -
python的字符操作函数
2009-08-07 10:25 2112在python有各种各样的stri ... -
python去除html标签
2009-08-07 10:24 3518from HTMLParser import HTMLPars ... -
python 下载文件
2009-08-06 14:12 4858抓取数据的时候,有的时候是需要下载一些文件的,比如图片,pdf ... -
python 去除空格,回车符,换行符
2009-08-06 14:05 10673s=’ as asdas \r\nasda’print ” ... -
Python版Linux 下的迅雷
2009-07-29 11:56 2876Linux 下该不该有迅雷,这个问题一直存在分歧,在此也不予讨 ... -
linux下python默认版本的选择
2009-07-29 10:50 2599当你在linux系统下安装了不同版本的python, 怎样设定 ... -
Python监视进程
2009-06-23 11:03 2498由subprocess创建一个进程,然后进行监视 每一秒钟查看 ... -
python pyc pyo
2009-06-19 13:56 4778python并非完全是解释性语言,它是有编译的,先把源码py文 ... -
python chr()、unichr()和ord()
2009-06-18 17:15 64218chr()、unichr()和ord() chr()函数用一 ... -
python打印所有汉字...
2009-06-18 17:04 2698for ch in xrange(0x4e00, 0x9fa6 ... -
程序签名
2009-06-18 16:43 1125打开https://www.symbiansigned.com ...
相关推荐
Python编程之PyS60是针对S60平台的Python应用开发课程,旨在教会开发者如何利用Python语言在诺基亚S60智能手机上构建应用程序。PyS60是由Python for S60(简称Pys60)项目提供的,它是一个移植版的Python解释器,...
Python for S60,简称PYS60,是诺基亚公司推出的一种在S60智能手机平台上运行Python编程语言的环境。这个平台允许开发者使用Python语言编写应用程序,为S60手机用户提供了丰富的功能和便捷的开发体验。"pys60例子...
PYS60,全称为Python for Series 60,是一个专为诺基亚S60平台设计的Python解释器,允许用户在S60智能手机上运行Python脚本,极大地扩展了设备的应用潜力。本次分享的是PYS60的1.4.5版本源代码,这个版本在社区中...
此外,还有`s60appuifw`模块用于创建应用程序框架,`s60symbianos`模块则提供了访问操作系统级别的功能,如电话、短信、蓝牙等。 手册中详细解释了这些模块的使用方法,包括每个函数的参数、返回值和可能的异常。...
总的来说,“pys60百例”是Pys60学习者的宝典,它通过实例化教学,帮助用户快速上手,深入理解Pys60的编程实践,为S60平台的Python应用开发打开了一扇窗。无论你是初学者还是资深开发者,都应该充分利用这个资源,...
1. **环境设置**:安装Python for S60的SDK,通常包括Python解释器、集成开发环境(IDE)如PyS60 Editor,以及必要的开发工具和文档。开发者需要在模拟器或实际设备上配置Python环境,以便进行测试和调试。 2. **...
pys60 是一个 Python 的移植版本,专为塞班(Symbian)操作系统设计,使得开发者能够使用 Python 语言在智能手机上创建应用程序。 Python API 在这里指的是 pys60 的 API 文档或库,这可能包括类、函数、模块和接口...
PyS60,全称为Python for Series 60,是一个为Symbian OS平台量身定制的Python解释器,使得开发者能够利用Python的强大功能来构建S60设备的应用程序。在1.9.7这个版本中,我们看到了对Symbian OS 9的支持,涵盖了S60...
- **PyS60**:一个允许开发者使用Python语言为S60平台编写应用程序的环境。PyS60提供了许多用于访问S60 API的模块。 - **appuifw模块**:PyS60中的一个核心模块,用于简化用户界面的开发。自PyS60 1.9.3版本起,...
在PyS60 1.4.5中,开发者可以利用Python的面向对象编程特性,创建复杂的程序结构,同时享受S60设备的硬件特性,如摄像头、GPS、蓝牙等。此外,通过Python的网络库,开发者还可以构建网络应用,实现数据交换和远程...
1. **环境搭建**:首先,你需要了解如何在S60设备上安装Python for S60的环境,包括Python解释器、编译器和相关的开发工具,如PyS60 SDK。 2. **基本语法**:Python的基础语法,如变量声明、数据类型(整型、浮点型...
PyS60允许开发者利用Python语言的强大功能来创建高效且易用的应用程序,这为那些熟悉Python但不熟悉传统移动开发语言(如Symbian C++或Java ME)的开发者提供了一个便捷的入口。 #### 移动应用开发面临的挑战 尽管...
运行Python脚本是Pys60的核心功能之一,无论是简单的测试脚本还是复杂的应用程序,都可以通过Pys60在S60设备上执行。 #### 4.3 使用交互式控制台 交互式控制台允许用户实时输入Python代码并立即查看结果,非常适合...
它允许开发者利用Python编写应用程序,并在S60智能手机上运行。该文档介绍了如何安装Python运行时及其依赖项,以及如何打包示例应用。同时,文档详细地介绍了各个模块的功能和服务,涵盖了系统服务、用户界面与图形...
3. **创建项目文件**: 使用Python for S60的打包工具,如PyS60 Installer或者OpenSignedOnline,创建一个描述你应用的XML配置文件(.sisxinfo或.app文件),这个文件会定义应用的元数据,如名称、版本和图标。...
Pys60是一个为Symbian S60平台设计的Python开发环境,它使得开发者能够利用Python语言开发Symbian S60系统的应用程序。本文档主要介绍了如何搭建Pys60的开发环境以及如何通过特定工具链来构建S60平台上的Python应用...
**PyS60**是专门为Symbian操作系统设计的一个Python实现版本,它极大地简化了应用程序开发过程,并为Symbian C++ API提供了一个脚本解决方案。此文档是针对**Python for S60** 1.4.1最终版编写的,该版本基于Python ...
pys60 实例 import time,socket,thread,sys,copy import appuifw,e32 ......
PyS60,作为Python在诺基亚S60平台上的实现,为移动设备带来了强大的编程能力。它结合了Python的灵活性和S60的广泛应用场景,使得开发者能够轻松创建功能丰富的应用程序,包括GUI界面的交互式应用。以下是对PyS60...