班级信息查询

发布时间:2022-06-28 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了班级信息查询脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

注册:

import wxFrom python import classinformationclass MyFrame(wx.Frame): def __inIT__(self,parent,id): wx.Frame.__init__(self,parent,id,title="班级信息收集程序",size=(600,400)) pl = wx.Panel(self) self.title = wx.staticText(pl,label="请输入要收集的班级、姓名、学号",pos=(200,20)) self.label_id = wx.StaticText(pl,label="学号:",pos=(50,50)) self.text_id = wx.TextCtrl(pl,pos=(100,50),size=(235,25),style=wx.TE_LEFT) self.label_bj = wx.StaticText(pl,label="班级:",pos=(50,90)) self.text_bj = wx.TextCtrl(pl, pos=(100, 90), size=(235, 25), style=wx.TE_LEFT) self.label_XM = wx.StaticText(pl, label="姓名:", pos=(50, 130)) self.text_xm = wx.TextCtrl(pl, pos=(100, 130), size=(235, 25), style=wx.TE_LEFT) self.BT_bc = wx.Button(pl,label="保存",pos=(100,170)) self.bt_bc.Bind(wx.EVT_BUTTON,self.Baochun) self.bt_qx = wx.Button(pl,label="取消",pos=(200,170)) self.bt_qx.Bind(wx.EVT_BUTTON, self.Cancel)

def Baochun(self,event): id = self.text_id.GetValue() bj = self.text_bj.GetValue() xm = self.text_xm.GetValue() if id =='' or bj == '' or xm == '': message = '输入为空!' else: classinformation.baochuninformation(id,bj,xm) message = '保存成功!' wx.MessageBox(message)

def Cancel(self,event): self.text_xm.SetValue('') self.text_bj.SetValue('') self.text_id.SetValue('') wx.MessageBox('取消成功!')

if __name__ == '__main__': app = wx.App() frame = MyFrame(parent=None,id=-1) frame.Show() app.MainLoop()

 

查询:

import wxfrom python import classinformationclass MyFrame(wx.Frame): def __init__(self,parent,id): wx.Frame.__init__(self,parent,id,title="班级信息查询程序",size=(600,400)) pl = wx.Panel(self) self.title = wx.StaticText(pl, label="班级信息查询程序", pos=(200, 20)) self.label_id = wx.StaticText(pl, label="请输入要查询同学的学号:", pos=(100, 70)) self.text_id = wx.TextCtrl(pl, pos=(100, 100), size=(235, 25), style=wx.TE_LEFT) self.bt_bc = wx.Button(pl, label="查询", pos=(100, 140)) self.bt_bc.Bind(wx.EVT_BUTTON, self.Chaxun) self.bt_qx = wx.Button(pl, label="取消", pos=(200, 140)) self.bt_qx.Bind(wx.EVT_BUTTON, self.Cancel)

def Chaxun(self,event):

id = self.text_id.GetValue() if id =='': message = '输入为空!' else: (a,b,c) = classinformation.chaxuninformation(id) message = """ 该同学姓名为: {:s} 班级为:{:s} """.format(c,b) wx.MessageBox(message)

pass

def Cancel(self, event):

self.text_id.SetValue('') wx.MessageBox('取消成功!')

if __name__ == '__main__': app = wx.App() frame = MyFrame(parent=None,id=-1) frame.Show() app.MainLoop()

 

班级信息查询

 

脚本宝典总结

以上是脚本宝典为你收集整理的班级信息查询全部内容,希望文章能够帮你解决班级信息查询所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。