本文整理汇总了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()