Advertisement
Peaser

Displaying Exceptions with wxPython

Jul 28th, 2014
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. import wx
  2.  
  3.  
  4. def wxMsgBox(Title, Content, MsgType=wx.OK, Icon=wx.ICON_INFORMATION):
  5.         app = wx.PyApp()
  6.         dlg = wx.MessageDialog(None, Content ,Title ,MsgType | Icon)
  7.         retCode = dlg.ShowModal()
  8.  
  9.  
  10.  
  11. try:
  12.         print 1/0 #zerodivision error
  13. except Exception,e: wxMBox.wxMsgBox("Exception", str(e), wxMBox.wx.OK, wxMBox.wx.ICON_ERROR)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement