-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimage.py
More file actions
42 lines (32 loc) · 1.09 KB
/
image.py
File metadata and controls
42 lines (32 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from tkinter import filedialog
from tkinter import *
import pymysql
import mysql.connector
from tkinter import messagebox
from mysql.connector import Error
from mysql.connector import errorcode
from caresys import *
connection = pymysql.connect(host='localhost',database='vehicle',user='root',password='')
cursor = connection.cursor()
def detec(name):
res = caresysfunc(0,name,0,'us')
return res
def process(x):
plate_no = x[0]
color = x[1]
make = x[5]
b_type = x[3]
model = x[4]
x=(plate_no,color,make,b_type,model)
query = """INSERT INTO crime_record(plate_no, color, make,body_type,model)
VALUES (%s,%s,%s,%s,%s) """
cursor.execute(query,x)
connection.commit()
messagebox.showinfo("Success!","Inserted "+ str(x) +" into blacklist")
def fileDialog():
filename = filedialog.askopenfilename(title = "Select A File")
return filename
def fetch():
cursor.execute("SELECT * FROM crime_record")
rows = cursor.fetchall()
return (rows)