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

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

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

- 登陆界面展示:

indexindex1
根据用户输入信息,判断密码是否正确以及身份是否对应。

# 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)

- 增删改查

  • 修改

Updata

  • 删除

delete

  • 增加

insert

  • 查询

select

- 签发违章罚单

签发违章罚单

- 违章罚单如图所示
违章罚单

  # -----
    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. 。。。

2020/4/15 更新

  • 更改Github上的代码错误
  • 执行了代码优化,提升了运行速度
  • 修改了代码的结构,以及将数据访问逻辑进行了整理
  • 注明了使用方法,即Readme.md
  • 增添了数据库文件
  • Github:https://github.com/meetchen/Traffic-Violation-Management-System
  • 如果可以的,点下star 三连一下,哈哈哈。谢谢你

有问题可以在我的博客留言

Leave a comment on my blog if you have any questions

Url : https://www.cduanran.com/guestbook/

Email :duanran@cduanran.com

  • 36
    点赞
  • 113
    收藏
    觉得还不错? 一键收藏
  • 54
    评论
评论 54
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值