首页 > 代码库 > Python下载进度条

Python下载进度条

import dialog,e32,appuifw
def ru(x):return x.decode(‘utf8‘)
def qu():
    appuifw.note(ru(‘已取消‘))
    wait.close()    
wait=dialog.Wait(ru(‘载入中…‘),True)

wait.show()
e32.ao_sleep(3)
wait.close()

pgrs = dialog.Progress(ru(‘请稍等…‘), 100)
pgrs.show()
print dir(pgrs)
try:
    a=0
    for i in range(100):
        i+=1;pgrs.set_label(ru(‘请稍等!\n进度:‘+str(i)+‘%‘))
        pgrs.goto(i)
        e32.ao_sleep(0.1)
    pgrs.close()
except:
    pgrs.close()

  

Python下载进度条