import sys sys.path += ["e:\\python"] import appuifw import sb_charge result = 1 while result: choice1 = [unicode("ホワイトプラン","utf-8"), unicode("オレンジプラン","utf-8"), unicode("ブループラン","utf-8"), unicode("全てのプラン","utf-8")] option = appuifw.popup_menu(choice1,unicode("通話プラン選択","utf-8")) if option is not None: choice2 = [unicode("携帯ブラウザのみ","utf-8"), unicode("PCサイトブラウザ","utf-8"), unicode("PCサイトダイレクト","utf-8"), unicode("AI接続","utf-8")] access = appuifw.popup_menu(choice2,unicode("接続方法","utf-8")) if access is not None: choice3 = [unicode("パケット数で入力","utf-8"), unicode("バイト数で入力","utf-8")] unit = appuifw.popup_menu(choice3,unicode("データ単位","utf-8")) if unit is not None: if unit == 0: data = appuifw.query(unicode("パケット送受信量","utf-8"), "number") packet = data byte = data * 128 / 1024 else: data = appuifw.query(unicode("データ送受信量(KB)","utf-8"), "number") packet = data * 1024 / 128 byte = data if data is not None: master = sb_charge.make_packet_master(packet,access) i = 0 temp = 0 charge = master[0] while master[i][2]: if option == master[i][0] or master[i][0] == 0: temp = master [i] if temp[2] < charge[2]: charge = temp elif option == 3: temp = master [i] if temp[2] < charge[2]: charge = temp i = i+1 cp, pp, ch = charge result = appuifw.query(unicode("最適プラン:","utf-8") + "\n" + pp + "\n" + str(byte) + "KB" + "\n" + str(packet) + "pkt" + "\n" + str(ch) + unicode("円","utf-8"), "query")