mzGUI_standalone.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:multiplierz 作者: BlaisProteomics 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号