def alerts(message='multiplierz', title='multiplierz', method='popup'):
"""Alert system for displaying popup or writing message to a file
Available methods equal 'popup' or 'file'.
If a file type method is chosen, the title represents the file name and location.
Example:
>> alerts('popup', 'Test', 'Hello. The test worked. Please click OK.')
"""
message = str(message)
title = str(title)
if method == 'popup':
try:
wx.MessageBox(message, title)
except wx._core.PyNoAppError:
app = mzApp()
app.launch()
wx.MessageBox(message, title)
elif method == 'file':
fh = open(title,'w')
fh.write(message)
fh.close()
评论列表
文章目录