wx.App(redirect=False, filename=None, useBestVisual=False,
clearSigInt=True)
import wx
class MyApp(wx.App):
def OnInit(self):
wx.MessageBox("Hello wxPython", "wxApp")
return True
if __name__ == "__main__":
app = MyApp(True, 'test.txt', True, True) # записываем вывод в test.txt
print("Something!!!")
app.MainLoop()
The four optional keyword arguments are as follows:
- redirect: If set to True, stdout is redirected to a debug window
- filename: If redirect is True and this is not None, then stdout can be redirected
to a file specified by this argument
- useBestVisual: This specifies whether the application should try to use the best
visuals provided by the underlying toolkit. (This has no effect on most systems.)
- clearSigInt: Setting this to True will allow the application to be terminated by
pressing Ctrl+C from the command line.