# _*_ coding:utf-8 _*_ import wx class MyFrame(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, title="班级信息收集", pos=(100, 100), size=(400, 300)) panel = wx.Panel(self) self.title=wx.StaticText(panel,label="请输入用姓名,班级和学号",pos=(140,20)) self.label_user = wx.StaticText(panel, label="性 名", pos=(50, 50)) self.text_user = wx.TextCtrl(panel, pos=(100, 50),size=(235,25),style=wx.TE_LEFT) self.label_class = wx.StaticText(panel,pos=(50, 80), label="班 级:" ) self.text_class = wx.TextCtrl(panel, pos=(100, 80),size=(235,25),style=wx.TE_LEFT) self.label_number = wx.StaticText(panel, pos=(50, 110), label="学 号:") self.text_number = wx.TextCtrl(panel, pos=(100, 110), size=(235, 25), style=wx.TE_LEFT) self.bt_confirm=wx.Button(panel,label="确定",pos=(125,150)) self.bt_cancel = wx.Button(panel, label="取消", pos=(225, 150)) if __name__ == "__main__": app = wx.App() frame = MyFrame(parent=None, id=-1) frame.Show() app.MainLoop()