本文整理匯總了Python中GUI.mainloop方法的典型用法代碼示例。如果您正苦於以下問題:Python GUI.mainloop方法的具體用法?Python GUI.mainloop怎麽用?Python GUI.mainloop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GUI
的用法示例。
在下文中一共展示了GUI.mainloop方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Tk
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import mainloop [as 別名]
# coding=utf-8
from GUI import *
Tk().withdraw()
result = messageBox.askquestion("開啟通訊錄", "是否已經有通訊錄檔案?\n按下「是」來開啟檔案;按下「否」來使用空白的通訊錄!", icon="question")
if result == "yes":
filename = askopenfilename(title="開啟通訊錄檔案", filetypes=[("通訊錄(Json)", ".json"), ("所有檔案", ".*")])
else:
filename = asksaveasfilename(title="另存通訊錄", filetypes=[("通訊錄(Json)", ".json"), ("所有檔案", ".*")])
if filename != "":
if filename[:-4:] != ".json":
filename += ".json"
with open(filename, "w") as file:
json.dump(dict(), file)
file.close()
Tk().destroy()
if filename != "":
root = Tk()
root.resizable(width=FALSE, height=FALSE)
app = GUI(master=root, file=filename)
app.mainloop()
app.focus_force()
示例2: disableButtons
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import mainloop [as 別名]
GUI.buttonforward.unbind("<ButtonRelease-1>")
GUI.buttonbackward.unbind("<ButtonRelease-1>")
GUI.buttonleft.config(state="disabled")
GUI.buttonright.config(state="disabled")
GUI.buttonforward.config(state="disabled")
GUI.buttonbackward.config(state="disabled")
GUI.buttonstop.config(state="disabled")
GUI.buttonresetcamera.config(state="disabled")
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
# datefmt='%y-%m-%d %H:%M:%S:%',
filename='clientGUI.log')
logging.info('Demarrage application')
HOST = '192.168.1.50' # IP Serveur
PORT = 10000
disableButtons()
# enableButtons()
globalVar = ClientGlobals.globalVar()
GUI.initGraph()
mySocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
isSocketConnected = False
GUI.buttonconnect.bind("<Button-1>", buttonconnectclick)
GUI.mainloop()