import wx
from python实验2 import classinformation
class 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 wx
from python实验2 import classinformation
class 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()

import sqlite3

def baochuninformation(a,b,c):
"""
:param a: 学生的学号 (id)
:param b: 班级 (bj)
:param c: 姓名 (xm)
:return:
"""
conn = sqlite3.connect('mrsoft.db')
cursor = conn.cursor()
e = (a,b,c)
cursor.execute('insert into classinformation (id,bj,xm) values (?,?,?)', e)
cursor.close()
conn.commit()
conn.close() def chaxuninformation(a):
'''
:param a: 学号
:return: 返回元组
''' b=()
conn = sqlite3.connect('mrsoft.db')
cursor = conn.cursor()
a=int(a)
cursor.execute('select * from classinformation where id = ?', (a,))
b= cursor.fetchone()
cursor.close()
conn.close()
return b #b是一个元组 if __name__=='__main__':
conn = sqlite3.connect('mrsoft.db')
cursor = conn.cursor()
# create table classinformation (id int(15) primary key, bj varchar (20), xm varchar (4))
a = ('20', '信计1班', '吕莹')
#cursor.execute('insert into classinformation (id,bj,xm) values (?,?,?)', a)
#cursor.execute('delete from classinformation where id = ?', (20,))
cursor.execute('select * from classinformation where id = ?', (20,))
b = cursor.fetchone()
print(b)
cursor.close()
conn.commit()
conn.close()

GUI程序设计--班级信息收集系的更多相关文章

  1. 最简单的方法是使用标准的 Linux GUI 程序之一: i-nex 收集硬件信息,并且类似于 Windows 下流行的 CPU-Z 的显示。 HardInfo 显示硬件具体信息,甚至包括一组八个的流行的性能基准程序,你可以用它们评估你的系统性能。 KInfoCenter 和 Lshw 也能够显示硬件的详细信息,并且可以从许多软件仓库中获取。

    最简单的方法是使用标准的 Linux GUI 程序之一: i-nex 收集硬件信息,并且类似于 Windows 下流行的 CPU-Z 的显示. HardInfo 显示硬件具体信息,甚至包括一组八个的流 ...

  2. 信息收集->DNS分析->dnsdict6

    如何获取域名的IPV4/IPV6地址之dnsdict6的使用 dnsdict6是一个用于获取网站信息的工具.dnsdict6可以扫描网站并显示有多少域或者子域,也可以扫描ipv6/ipv4地址.dns ...

  3. Kali Linux信息收集工具

    http://www.freebuf.com/column/150118.html 可能大部分渗透测试者都想成为网络空间的007,而我个人的目标却是成为Q先生! 看过007系列电影的朋友,应该都还记得 ...

  4. Kali Linux信息收集工具全集

    001:0trace.tcptraceroute.traceroute 描述:进行路径枚举时,传统基于ICMP协议的探测工具经常会受到屏蔽,造成探测结果不够全面的问题.与此相对基于TCP协议的探测,则 ...

  5. Kali Linux信息收集工具全

    可能大部分渗透测试者都想成为网络空间的007,而我个人的目标却是成为Q先生! 看过007系列电影的朋友,应该都还记得那个戏份不多但一直都在的Q先生(由于年级太长目前已经退休).他为007发明了众多神奇 ...

  6. ATL的GUI程序设计(4)

    第四章 对话框和控件 对于Win32 GUI的程序设计来说,其实大部分的情况下我们都不需要自己进行窗口类的设计,而是可以使用Win32中与用户交互的标准方式--对话框(Dialog Box).我们可以 ...

  7. ATL的GUI程序设计(3)

    第三章 ATL的窗口类 CWindowImpl.CWindow.CWinTraits,ATL窗口类的奥秘尽在此三者之中.在本章里,李马将为你详细解说它们的使用方法.另外,本章的内容也可以算是本书的核心 ...

  8. ATL的GUI程序设计(2)

    from:http://blog.titilima.com/atlgui-2.html 第二章 一个最简单窗口程序的转型 我知道,可能会有很多朋友对上一章的"Hello, World!&qu ...

  9. ATL的GUI程序设计(1)

    from:http://blog.titilima.com/atlgui-1.html 第一章 不能免俗的"Hello, World!" 在这一章里,就像所有的入门级教程一样,我也 ...

  10. 渗透测试之信息收集(Web安全攻防渗透测试实战指南第1章)

    收集域名信息 获得对象域名之后,需要收集域名的注册信息,包括该域名的DNS服务器信息和注册人的联系方式等. whois查询 对于中小型站点而言,域名所有人往往就是管理员,因此得到注册人的姓名和邮箱信息 ...

随机推荐

  1. ClickHouse exception, code: 62, host: hadoop102, port: 8123; Code: 62, e.displayText() = DB::Exception: Syntax error: failed at position 183 (end of query):

    报错 ClickHouse exception, code: 62, host: hadoop102, port: 8123; Code: 62, e.displayText() = DB::Exce ...

  2. 自动化测试方案对比:Katalon vs Python

    公司要用katalon做自动化,我提议用更加主流的python的方案,即pytest+selenium.下面是做一个大概的对比,以引导团队尽可能的选择可靠的方案. 接下来我直接把我当时讲的ppt贴上来 ...

  3. .net 移动mas短信接口开发

    接口文档下载 1.移动后台接入用户新增(选择HTTP协议) 2.后台代码 /// <summary>    /// 用户名    /// </summary>    priva ...

  4. CGLB动态代理

    CGLB动态代理 一.CGLIB实现接口 public interface ProductInterface { void test(); } /** * 用来测试接口 */ private stat ...

  5. ISE_14.7_Windows10安装

    直接下载安装会报如下错误: There was an unexpected error executing Import ISE Virtual Appliance 解决方案 1.阅读xilinx手册 ...

  6. vitis笔记1

    安装vitis2021.1 配置环境 添加环境变量 下载包 install 注意:切换到<install_dir>/Vitis//scripts/installLibs.sh,执行指令时候 ...

  7. EF core 反向工程 连接字符串

    Scaffold-DbContext 'Data Source=.;Initial Catalog=DB;User ID=sa;Password=1;Integrated Security=true; ...

  8. 尺取法 C - Vasya and String CodeForces - 676C

    C - Vasya and String CodeForces - 676C #include<iostream> using namespace std; int main() { lo ...

  9. C - Functions again CodeForces - 789C (dp、思维)

    C - Functions again CodeForces - 789C #include<iostream> #include<cstdio> #include<cm ...

  10. Django中遇到的问题

    1.如右上角无Dj的 Django标识 解决方法1: 关闭Pycharm 重启创建项目,进入到Django的所在目录下 解决方法2: 方法3: 第一步: 第二步: 第三步: 第四步: 2.如下图:显示 ...