import
wx
class
Example(wx.Frame):
def
__init__(
self
,
*
args,
*
*
kwargs):
super
(Example,
self
).__init__(
*
args,
*
*
kwargs)
self
.InitUI()
def
InitUI(
self
):
self
.locale
=
wx.Locale(wx.LANGUAGE_ENGLISH)
self
.panel
=
wx.Panel(
self
, pos
=
(
100
,
100
), size
=
(
100
,
100
))
self
.btn
=
wx.Button(
self
.panel,
id
=
2
, label
=
"Exit"
, pos
=
wx.DefaultPosition, size
=
(
100
,
20
))
self
.Bind(wx.EVT_BUTTON,
self
.onclick,
self
.btn)
def
onclick(
self
, e):
wx.Exit()
def
main():
app
=
wx.App()
ex
=
Example(
None
)
ex.Show()
app.MainLoop()
if
__name__
=
=
'__main__'
:
main()