Untitled
Untitled
Untitled
connector as sql
conn=sql.connect(host='localhost',user='root',passwd='manager',database='grocery_shop')
if conn.is_connected():
print('successfully connected')
c=conn.cursor()
print('1.login')
print('2.exit')
if choice==1:
print('connected successfully')
print('grocery shop')
print('1.customer details')
print('2.product details')
print('3.worker details')
if choice==1:
c.execute(sql_insert)
conn.commit()
print('data is updated')
elif choice==2:
c.execute(sql_insert)
conn.commit()
print('data is updated')
elif choice==3:
c.execute(sql_insert)
conn.commit()
print('data is updated')
elif choice==4:
t=conn.cursor()
t.execute('select*from customer_details')
record=t.fetchall()
for i in record:
print(i)
elif choice==5:
t=conn.cursor()
t.execute('select*from product_details')
record=t.fetchall()
for i in record:
print(i)
elif choice==6:
t=conn.cursor()
t.execute('select*from worker_details')
record=t.fetchall()
for i in record:
print(i)
elif choice==7:
c.execute(t)
v=c.fetchall()
for i in v:
print(v)
elif choice==8:
c.execute(t)
v=c.fetchall()
for i in v:
print(v)
elif choice==9:
c.execute(t)
v=c.fetchall()
for i in v:
print(v)
elif choice==10:
print('******************************************')
f=open('test.txt','r')
data=f.read()
print(data)
f.close()
print('******************************************')
elif choice==11:
avalibility=[156,200,103,206,196]
colors=['red','yellowgreen','blue','gold','lightcoral']
plt.pie(avalibility,labels=items,colors=colors)
plt.show()
else:
if choice==2:
exit()