本文整理匯總了Python中easygui.msgbox方法的典型用法代碼示例。如果您正苦於以下問題:Python easygui.msgbox方法的具體用法?Python easygui.msgbox怎麽用?Python easygui.msgbox使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類easygui
的用法示例。
在下文中一共展示了easygui.msgbox方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: connectStim
# 需要導入模塊: import easygui [as 別名]
# 或者: from easygui import msgbox [as 別名]
def connectStim():
accepted=False
choice=""
while not accepted:
thePorts=headset.getPorts()
if len(thePorts) < 1:
eg.msgbox(title="No devices connected",msg="No devices were detected. Make sure the BrainKit stimulator is connected and powered on and try again")
portSelect="Cancel"
else:
print(str(thePorts))
portSelect=eg.buttonbox(title="Stimulator port", msg="Select the port to which the stimulator is connected. If you do not know the port, connected or unplug the stimultor and click refresh", choices=[thePorts, "Refresh"])
if portSelect and "Refresh" not in portSelect:
accepted=True
choice=portSelect
if "Cancel" not in portSelect:
try:
print(str(choice))
print("Attempting to connect to stimulator...")
headset.getConnection(choice[0][0])
return True
except Exception:
return False
示例2: errorPrompt
# 需要導入模塊: import easygui [as 別名]
# 或者: from easygui import msgbox [as 別名]
def errorPrompt(errorMsg):
print 'Error: ' + errorMsg
easygui.msgbox(msg = errorMsg, title = 'ERROR', ok_button = 'OK')
quit()