易码技术论坛

 找回密码
 加入易码
搜索
查看: 189714|回复: 4

学习python for s60

[复制链接]
发表于 2006-6-21 18:52:00 | 显示全部楼层
http://mobilenin.com/pys60/info_syntax.htm

语法摘要:1。对于Python来说,代码缩进是语法问题,而不是风格问题。
          类C语言是用大括号{}来限定一个语句块。而Python则是靠缩进。
          任何语句如果在同一个语句块里,它们的缩进必定是一致的。

          2。使用变量不需要声明类型,语句后面的分号可有可无。。
          ……………………………………………………

基本字符串输入/输出:
参考资料:http://mobilenin.com/pys60/ex_text_input_1.htm
不知道为什么。。使用标准raw_inputs()字符串输入语句。。在pys60里会出错。。郁闷。

  1. import appuifw
  2. data=appuifw.query("Please inputs:","text");#输入
  3. appuifw.note(u"Your inputs string"+data);#输出
复制代码

 楼主| 发表于 2006-6-21 19:21:00 | 显示全部楼层
更多输入输出示例:
参见:http://mobilenin.com/pys60/info_dialogue_notes.htm
总结appuifw.query第二个参数可选项:
text:文字,number:数字,…………
总结appuifw.note第二个参数可选项:
info:大i,error:感叹号,conf:一个勾(提示图标。。)

弹出菜单:
参见:http://mobilenin.com/pys60/ex_popup_menu.htm

  1. import appuifw

  2. L = [u"Python", u"Symbian", u"Mlab"]

  3. test = appuifw.popup_menu(L, u"Select + press OK:")

  4. if test == 0 :
  5.     appuifw.note(u"Python, yeah", "info")
  6. elif test == 1 :
  7.     appuifw.note(u"Symbian, ok", "info")
  8. elif test == 2 :
  9.     appuifw.note(u"Mlab, cool students", "info")

复制代码

 楼主| 发表于 2006-6-21 19:41:00 | 显示全部楼层
更多UI:
Multi_query, Selection_list, Multi_selectionlist
参见:http://mobilenin.com/pys60/info_popup_menu_selection_list.htm

  1. from appuifw import multi_query
  2. data1,data2 = multi_query(u"Type your first name:",u"Type your surname:")
  3. print data1,date2
复制代码


Selection_list: appuifw.selection_list(choices=list , search_field=1)

  1. import appuifw

  2. # define the list of items (put a u in front - items must be written in unicode!)
  3. L = [u'cakewalk', u'com-port', u'computer', u'bluetooth', u'mobile', u'screen'', u'keys']

  4. # create the selection list
  5. index = appuifw.selection_list(choices=L , search_field=1)

  6. # use the result of the selection to trigger some action (here we just print something)
  7. if index == 0:
  8.     print "cakewalk was selected"
  9. else:
  10.     print "thanks for choosing"



  11. #NOTE: search_field=1 displays a search pane at the end of you list

  12. #search_field=0 no search pane is displayed

复制代码



Multi_selectionlist:
2 different ones:
1. with checkbox: appuifw.multi_selection_list(list , style='checkbox', search_field=1)
2. with checkmark: appuifw.multi_selection_list(L , style='checkmark', search_field=1)


  1. from appuifw import *

  2. L = [u'cakewalk', u'com-port', u'computer', u'bluetooth', u'mobile', u'screen', u'camera', u'keys']

  3. # create the multi-selection list
  4. index = multi_selection_list(L , style='checkbox', search_field=1)

  5. # create a new list (Lnew) that inlcudes only the selected items and print the new list (Lnew)
  6. Lnew = index
  7. print Lnew

复制代码

发表于 2006-6-22 17:16:00 | 显示全部楼层
好东西

找个时间玩玩
 楼主| 发表于 2006-6-21 18:02:19 | 显示全部楼层 |阅读模式
参考资料:http://mobilenin.com/pys60/menu.htm
硬件配备:s60手机(如QD)、读卡器。

软件配备:软件本身--根据你的手机型号选一个下载安装到MMC卡里。

下载地址:http://mobilenin.com/pys60/pys60_installation_resources.htm

PythonForS60_2ndEd_1_3_1.SIS (for phone model: 6600, 6630, 6670, 7610)

PythonForS60_2ndEdFP3_1_3_1.SIS (for phone model: N70, N90)

PythonForS60_1stEd_1_3_1.SIS (for phone model: N-Gage QD)


以下软件如没提供下载地址请到sisdown下载。。

SeleQ或其他文件管理工具。

s60上的Text Editor。。如Yedit(代码要保存为ASCII或ANSI编码,文件名后缀为.py的文本文件,不要保存为unicode的。。)

加强版本的pys60人机交互Console.py。。放到E:/System/app/Python/下。。
下载地址:里面的AIKON。。 那里面的pyed我运行不起来。。郁闷。。
http://sourceforge.net/projects/pyed

好,准备工作基本完成。。接下来就正式接触python for s60
您需要登录后才可以回帖 登录 | 加入易码

本版积分规则

Archiver|手机版|小黑屋|EMAX Studio

GMT+8, 2024-4-24 10:15 , Processed in 0.017699 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表