CHEMIST sql
CHEMIST sql
connector
mydb.commit()
print("Database Initialised")
# library import
import mysql.connector as sql
import time
import random as rd
def medicine():
# function to add a medicine
def addmedicine():
print("\n")
print("😇🙃" * 15)
print("\n")
mid = input("Enter Medicine Id : ")
name = input("Enter Medicine Name : ")
mf = input("Enter Name of Manufacturer : ")
dom = input("Enter Date of Manufacture : ")
doe = input("Enter Date of Expiry : ")
mg = input("Enter the Weight (in mg) : ")
content = input("Enter Content : ")
price = input("Enter the Price : ")
qty = input("Enter the Quantity : ")
print("\nSTORING MEDICINE DETAILS.......")
time.sleep(2)
q = "insert into medicine values(%s,%s,%s,%s,%s,%s,%s,%s,%s)"
data = (mid, name, mf, dom, doe, mg, content, price, qty)
cr = mydb.cursor()
cr.execute(q, data)
print("\nMedicine Inserted.......!!!!")
😎 * 15)
print(""
print("\n")
mydb.commit()
# setting conection
mydb = sql.connect(host="localhost", user="root", password="akarsh05",
database="medicine_shop")
# login screen
a = rd.randint(1, 9)
b = rd.randint(1, 9)
c = rd.randint(1, 9)
d = rd.randint(1, 9)
e = rd.randint(1, 9)
num = str(a) + str(b) + str(c) + str(d) + str(e)
print("\t\t", num)
n = int(input("Enter The Number Shown Above : "))
if str(n) == num:
print("Yayyyiieee...You've Successfully Entered the Market..!!")
if mydb.is_connected():
print("🥳🥳🎁" * 10)
print("\n")
print("\t\t\tCHEMIST SHOP MANAGEMENT")
print("\n")
print("🥳🥳🎁" * 10)
medicine()
🙃 * 15)
print(""
print("\t\tThanks for Visiting....!!!")
🙃 * 15)
print(""
else:
print("Connection Error !!!!!")
else:
print("Seems like it's not a human being -__-")
print("You Can't Enter The Software. SORRY >_____<")