-
Notifications
You must be signed in to change notification settings - Fork 0
/
qrcode.py
158 lines (137 loc) · 6.31 KB
/
qrcode.py
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import pyqrcode
import sqlite3
from PIL import Image,ImageTk
from tkinter import *
def qrcode(root,name):
root.geometry("300x300")
global conn, c, connect, co, join, j,addit,a
addit = sqlite3.connect('sports.db')
a = addit.cursor()
join = sqlite3.connect("C:/Users/vrush/OneDrive/Desktop/Mini_Proj/grocery.db")
j = join.cursor()
connect = sqlite3.connect("C:/Users/vrush/OneDrive/Desktop/Mini_Proj/clothing.db")
co = connect.cursor()
conn = sqlite3.connect("C:/Users/vrush/OneDrive/Desktop/Mini_Proj/electronics.db")
c = conn.cursor()
list=[]
global p
if name == 'mobile':
p = c
c.execute('SELECT rowid, * FROM mobile')
r = p.fetchall()
for i in r:
list.append("Item Name" + str(i[1]) + " " + "Quantity" + str(i[2]))
qr = pyqrcode.create(str(list))
qr.png('mobile.png', scale=8)
root.bg = ImageTk.PhotoImage(file="C:/Users/vrush/OneDrive/Desktop/Mini_Proj/mobile.png")
root.bg_image = Label(root, image=root.bg).place(x=0, y=0, relwidth=1, relheight=1)
elif name == 'Laptop':
p = c
c.execute('SELECT rowid, * FROM Laptop')
r = p.fetchall()
for i in r:
list.append("Item Name" + str(i[1]) + " " + "Quantity" + str(i[2]))
qr = pyqrcode.create(str(list))
qr.png('laptop.png', scale=8)
root.bg = ImageTk.PhotoImage(file="C:/Users/vrush/OneDrive/Desktop/Mini_Proj/laptop.png")
root.bg_image = Label(root, image=root.bg).place(x=0, y=0, relwidth=1, relheight=1)
elif name == 'Washing_Machine':
p = c
c.execute('SELECT rowid, * FROM WashingMachine')
r = p.fetchall()
for i in r:
list.append("Item Name" + str(i[1]) + " " + "Quantity" + str(i[2]))
qr = pyqrcode.create(str(list))
qr.png('washing.png', scale=8)
root.bg = ImageTk.PhotoImage(file="C:/Users/vrush/OneDrive/Desktop/Mini_Proj/washing.png")
root.bg_image = Label(root, image=root.bg).place(x=0, y=0, relwidth=1, relheight=1)
elif name == 'women':
p = co
co.execute('SELECT rowid, * FROM women')
r = p.fetchall()
for i in r:
list.append("Item Name" + str(i[1]) + " " + "Quantity" + str(i[2]))
qr = pyqrcode.create(str(list))
qr.png('women.png', scale=8)
root.bg = ImageTk.PhotoImage(file="C:/Users/vrush/OneDrive/Desktop/Mini_Proj/women.png")
root.bg_image = Label(root, image=root.bg).place(x=0, y=0, relwidth=1, relheight=1)
elif name == 'men':
p = co
co.execute('SELECT rowid, * FROM men')
r = p.fetchall()
for i in r:
list.append("Item Name" + str(i[1]) + " " + "Quantity" + str(i[2]))
qr = pyqrcode.create(str(list))
qr.png('men.png', scale=8)
root.bg = ImageTk.PhotoImage(file="C:/Users/vrush/OneDrive/Desktop/Mini_Proj/men.png")
root.bg_image = Label(root, image=root.bg).place(x=0, y=0, relwidth=1, relheight=1)
elif name == 'children':
p = co
co.execute('SELECT rowid, * FROM children')
r = p.fetchall()
for i in r:
list.append("Item Name" + str(i[1]) + " " + "Quantity" + str(i[2]))
qr = pyqrcode.create(str(list))
qr.png('children.png', scale=8)
root.bg = ImageTk.PhotoImage(file="C:/Users/vrush/OneDrive/Desktop/Mini_Proj/children.png")
root.bg_image = Label(root, image=root.bg).place(x=0, y=0, relwidth=1, relheight=1)
elif name == 'food':
p = j
j.execute('SELECT rowid, * FROM food')
r = p.fetchall()
for i in r:
list.append("Item Name" + str(i[1]) + " " + "Quantity" + str(i[2]))
qr = pyqrcode.create(str(list))
qr.png('food.png', scale=8)
root.bg = ImageTk.PhotoImage(file="C:/Users/vrush/OneDrive/Desktop/Mini_Proj/food.png")
root.bg_image = Label(root, image=root.bg).place(x=0, y=0, relwidth=1, relheight=1)
elif name == 'household':
p = j
j.execute('SELECT rowid, * FROM household')
r = p.fetchall()
for i in r:
list.append("Item Name" + str(i[1]) + " " + "Quantity" + str(i[2]))
qr = pyqrcode.create(str(list))
qr.png('household.png', scale=8)
root.bg = ImageTk.PhotoImage(file="C:/Users/vrush/OneDrive/Desktop/Mini_Proj/household.png")
root.bg_image = Label(root, image=root.bg).place(x=0, y=0, relwidth=1, relheight=1)
elif name == 'cooking':
p = j
j.execute('SELECT rowid, * FROM cooking')
r = p.fetchall()
for i in r:
list.append("Item Name" + str(i[1]) + " " + "Quantity" + str(i[2]))
qr = pyqrcode.create(str(list))
qr.png('cooking.png', scale=8)
root.bg = ImageTk.PhotoImage(file="C:/Users/vrush/OneDrive/Desktop/Mini_Proj/cooking.png")
root.bg_image = Label(root, image=root.bg).place(x=0, y=0, relwidth=1, relheight=1)
elif name == 'sportsw':
p = a
a.execute('SELECT rowid, * FROM wear')
r = p.fetchall()
for i in r:
list.append("Item Name" + str(i[1]) + " " + "Quantity" + str(i[2]))
qr = pyqrcode.create(str(list))
qr.png('sportswear.png', scale=8)
root.bg = ImageTk.PhotoImage(file="C:/Users/vrush/OneDrive/Desktop/Mini_Proj/sportswear.png")
root.bg_image = Label(root, image=root.bg).place(x=0, y=0, relwidth=1, relheight=1)
elif name == 'gym':
p = a
a.execute('SELECT rowid, * FROM gym')
r = p.fetchall()
for i in r:
list.append("Item Name" + str(i[1]) + " " + "Quantity" + str(i[2]))
qr = pyqrcode.create(str(list))
qr.png('gym.png', scale=8)
root.bg = ImageTk.PhotoImage(file="C:/Users/vrush/OneDrive/Desktop/Mini_Proj/gym.png")
root.bg_image = Label(root, image=root.bg).place(x=0, y=0, relwidth=1, relheight=1)
elif name == 'SportsAccessories':
p = a
a.execute('SELECT rowid, * FROM accessories')
r = p.fetchall()
for i in r:
list.append("Item Name" + str(i[1]) + " " + "Quantity" + str(i[2]))
qr = pyqrcode.create(str(list))
qr.png('accossories.png', scale=8)
root.bg = ImageTk.PhotoImage(file="C:/Users/vrush/OneDrive/Desktop/Mini_Proj/accossories.png")
root.bg_image = Label(root, image=root.bg).place(x=0, y=0, relwidth=1, relheight=1)