Python(Tkinter)+Mysql 交通违章管理系统

数据库课程设计、 交通违章管理系统

实现对车辆、司机、警察、违章及处罚等信息**增加、删除、修改、查询**,并能够查询和显示出交通违章通知等信息。
涉及:python、tkinter、mysql 、pymysql。望各位大佬指正。

登陆界面展示:

在这里插入图片描述
在这里插入图片描述
根据用户输入信息,判断密码是否正确以及身份是否对应。

# login command function
def login():
    identity_var = identity.get()
    user = userE.get()
    password = passwordE.get()
    # python Sequence unpacking
    if usertable.UserSelect(user) != 'error':
        password_sql, user_identity = usertable.UserSelect(user)
        print(identity_var, user_identity)
        if password == password_sql and identity_var == '1' or '2':
            if identity_var == '1' and str(user_identity) == '1':
                # login police_system
                tkinter.messagebox.showinfo(title='Landing', message='Verification passed')
                if 1:
                    Police_Windows1(user)
            elif identity_var == '0' == str(user_identity):
                # login driver_system
                tkinter.messagebox.showinfo(title='Landing', message='Verification passed')
                if 1:
                    Driver_Windows(user)
            else:
                tkinter.messagebox.showinfo(title='Landing', message='Identity error')
        else:
            tkinter.messagebox.showinfo(title='Landing', message='Password error')
    else:
        tkinter.messagebox.showinfo(title='Landing', message='User name does not exist')

警察操作界面:

在这里插入图片描述
部分代码

    # Driver
    btt = tkinter.Button(windows1, text='Select', font=('Arial', 12), command=driver.driver)
    btt.place(x=400, y=140)
    btt1 = tkinter.Button(windows1, text='Delete', font=('Arial', 12), command=tkwindows.delete_windows)
    btt1.place(x=500, y=140)
    btt2 = tkinter.Button(windows1, text='Update', font=('Arial', 12), command=tkwindows.update_windows)
    btt2.place(x=600, y=140)
    btt3 = tkinter.Button(windows1, text='Insert', font=('Arial', 12), command=tkwindows.insert_windows)
    btt3.place(x=700, y=140)
    # Police
    btt4 = tkinter.Button(windows1, text='Select', font=('Arial', 12), command=police.policeSelect)
    btt4.place(x=400, y=200)
    btt5 = tkinter.Button(windows1, text='Delete', font=('Arial', 12), command=tkwindows.police_delete_windows)
    btt5.place(x=500, y=200)
    btt6 = tkinter.Button(windows1, text='Update', font=('Arial', 12), command=tkwindows.police_update_windows)
    btt6.place(x=600, y=200)
    btt7 = tkinter.Button(windows1, text='Insert', font=('Arial', 12), command=tkwindows.police_insert_windows)
    btt7.place(x=700, y=200)

增删改查

修改
在这里插入图片描述

删除

在这里插入图片描述
增加
在这里插入图片描述

查询
在这里插入图片描述

  • 签发违章罚单
    在这里插入图片描述

  • 违章罚单如图所示
    在这里插入图片描述

  # -----
    line3 = tk.Label(text='__________________________________________________________________________________________'
                          '______________________________________')
    line3.place(x=30, y=395)
    # punish
    punish_type = tk.Label(text='Punish_type: ', font=('Arial', 13))
    punish_type.place(x=50, y=435)
    # punish_type = tk.Label(text=tuple[-5], font=('Arial', 13))
    # punish_type.place(x=100, y=435)
    punish_type1 = tk.Label(text='□Warning', font=('Arial', 13))
    punish_type1.place(x=150, y=475)
    punish_type2 = tk.Label(text='□Fine', font=('Arial', 13))
    punish_type2.place(x=400, y=475)
    punish_type3 = tk.Label(text='□Temporary withholding of driver license', font=('Arial', 13))
    punish_type3.place(x=150, y=515)
    # -----
    line4 = tk.Label(text='__________________________________________________________________________________________'
                          '______________________________________')
    line4.place(x=30, y=535)
    # Police Signature
    police_signature = tk.Label(text='Police Signature :', font=('Arial', 13))
    police_signature.place(x=50, y=575)
    police_id = tk.Label(text='Police Id :', font=('Arial', 13))
    police_id.place(x=400, y=575)
    # -----
    line5 = tk.Label(text='__________________________________________________________________________________________'
                          '______________________________________')
    line5.place(x=30, y=605)

系统存在问题:

 1. 数据库字段设置不够严谨
 2. 图像界面后续窗口设计不够完善
 3. 。。。

猜你喜欢

转载自blog.csdn.net/weixin_42625143/article/details/94622761