[其他] 有人在手机上玩Python么?

NO1111 2008-10-12
# -*- coding: utf-8 -*-

import appuifw, e32
         
## Simple MyFormView class to demonstrate the use of forms.
class MyFormView( object ):
    
    ## The constructor.
    def __init__( self ):
        ## Bool
        self._iIsSaved = False
 
        ## Model list.
        self._iModels = [u'6600', u'6630', u'7610', u'N90', u'N70']
        ## Form fields.
        self._iFields = [( u'Mobile', 'text', u'Nokia'),
                         ( u'Model', 'combo', ( self._iModels, 0 ) ),
                         ( u'Amount','number', 5 ),
                         ( u'Date','date' ),
                         ( u'Time','time' )]
 
 
    ## Displays the form.
    def setActive( self ):
        self._iIsSaved = False
        self._iForm = appuifw.Form(self._iFields, appuifw.FFormEditModeOnly)
        self._iForm.save_hook = self.mainForm
        self._iForm.flags = appuifw.FFormEditModeOnly
        self._iForm.execute( )
 
 
    ## save_hook send True if the form has been saved.
    def _markSaved( self, aBool ):
        self._iIsSaved = aBool
                
    ## _iIsSaved getter.
    def isSaved( self ):
        return self._iIsSaved
 
    ## Return mobile field value.
    def getMobile( self ):
        ## This returns the mobile; In one case I needed to have UTF-8 encoding
        return self._iForm[0][2].encode( "utf-8" )

    def mainForm(self, aBool):
        if aBool:
            print u'for test.......'
            menus = [u'pinfo', u'acct mang', u'acct trans']
            appuifw.app.body = appuifw.Listbox(menus)
        
if __name__ == "__main__":
    app_lock = e32.Ao_lock()
    appuifw.app.title = u'Try Forms'
    myForm = MyFormView( )
    myForm.setActive( )
    if not myForm.isSaved( ):
        pass
        #print myForm.getMobile( )
谁知道这个程序为什么能打出'for test.....',但必需要等按右边的返回键才可以么?我想让它马上显示listbox,为什么不行呢?
poson 2009-06-21
mikel 写道
我用手机写python程序,坐公交时候编程

我崇拜你...
fendydeng 2009-07-08
用PED写
Global site tag (gtag.js) - Google Analytics