KENDRIYA VIDYALAYA
EMBASSY OF INDIA
KATHMANDU NEPAL
INVESTIGATORY PROJECT
COMPUTER
2025-26
SUBMITTED BY: SUBMITTED TO:
KELVIN POUDEL MR. KAMAL KANT GUPTA
XII ‘A’
12122
CERTIFICATE
This is to certify that Kelvin Poudel, a student of class
XII section A has successfully completed project on
COMPUTER under the guidance of Mr KAMAL
KANT GUPTA, during academic year 2025-26 in
partial fulfillment of Chemistry practical examination
conducted by CBSE.
TEACHER SIGNATURE PRINCIPAL SIGNATURE
EXTERNAL EXAMINAR SIGNATURE
ACKNOWLEDGEMENT
In the accomplishment of this project successfully,
many people have best owned upon me their
blessings and the heart pledged support, this time I
am utilizing to thank all the people who have been
concerned with this project.
Primarily I would Thank God for being able to
complete this Project with success. Then I would
like to thank my Principal, Mr A Jerald and my
Computer teacher Mr. Kamal Kant Gupta, whose
valuable guidance has been the one that helped me
patch this project and make it full Proof success
her suggestions and her instructions had served as
the Major contribution towards the completion of
the project.
Then I would like to thank my parents and my
friends who have helped me with their valuable
suggestions and guidance has been helpful in
various phases of the completion of the Project.
DECLARATION
I, KELVIN POUDEL do hereby declare that the
Computer Science Project Titled “PHARMACY-
MANAGEMENT-SYSTEM” is an original work
done by me under the guidance of the Computer
Science Teacher. This is the outcome of the
research and study done by me over a period of
one year using various primary and secondary
sources. All external sources and references that
have been used by me for the project, have been
duly acknowledged.
Kelvin Poudel
XII ‘A’
INTRODUCTION
The Pharmacy Management System is a digital tool
designed to manage the day-to-day operations of a
pharmacy efficiently. It helps in maintaining accurate
records of medicines, tracking inventory, processing
sales, and managing suppliers. By automating these
tasks, the system reduces human errors, saves time, and
ensures smooth operations, making it an essential tool
for pharmacists and healthcare providers.
CODE
import [Link]
import datetime
from [Link] import canvas
def sql_connection():
try:
mydb=[Link](host='localhost', user='root', password='9813438460',
database='medical_store')
except:
mydb=[Link](host='localhost', user='root', password='9813438460')
mycursor=[Link]()
[Link]('CREATE DATABASE medical_store')
[Link]('USE medical_store')
[Link]("CREATE TABLE medicines(medi_id int primary key
AUTO_INCREMENT, medi_name varchar(70) , price int, quantity int, expiry_date date)")
[Link]('CREATE TABLE users(username varchar(70) primary key,
password varchar(70), is_staff int , is_admin int, full_name varchar(70))')
[Link]("CREATE TABLE sold_items(id int primary key
AUTO_INCREMENT,sold_on date, sold_to varchar(70) ,quantity_sold int, price int,
medicine_id int)")
[Link]("CREATE TABLE medicine_requests(request_id int primary key
AUTO_INCREMENT, medi_name varchar(70) , quantity int)")
print('DATABASE AND TABLE CREATED')
return mydb
def home(mydb,cart):
XYZ=input("PRESS ENTER TO VIEW HOME PAGE")
print('\t\t*-----Home-----*\t\t')
print('1: View Stock')
print('2: Add Medicine')
print('3: Update existing Medicine')
print('4: request medicine')
print('5: View Medicine Requests')
print('6: Search and Sell Medicine')
print('7: View Cart')
print('8: delete medicines')
print('9: Medicine Info')
print('10: Exit')
x=int(input('Enter 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 10: '))
if x == 1:
view_stock(mydb)
elif x == 2:
add_medicine(mydb)
elif x==3:
update_medi(mydb)
elif x==6:
search_medicine(mydb,cart)
elif x==7:
view_cart(cart)
elif x==5:
view_requests(mydb,cart)
elif x==4:
request_medicine(mydb, cart)
elif x==8:
delete_medi(mydb)
elif x==9:
all_list()
else:
exit()
def home1(mydb,cart):
XYZ=input("PRESS ENTER TO VIEW HOME PAGE")
print('\t\t*-----Home-----*\t\t')
print('1: View Stock')
print('2: Add Medicine')
print('3: Update existing Medicine')
print('4: request medicine')
print('5: View Medicine Requests')
print('6: Search and Sell Medicine')
print('7: View Cart')
print('8: delete medicines')
print('9: Medicine Info')
print('10: Remove staff')
print('11: Exit')
x=int(input('Enter 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 10 or 11: '))
if x == 1:
view_stock1(mydb)
elif x == 2:
add_medicine1(mydb)
elif x==3:
update_medi1(mydb)
elif x==6:
search_medicine1(mydb,cart)
elif x==7:
view_cart1(cart)
elif x==5:
view_requests1(mydb,cart)
elif x==4:
request_medicine1(mydb, cart)
elif x==8:
delete_medi1(mydb)
elif x==9:
all_list1()
elif x==10:
remove_staff1(mydb)
else:
exit()
def signup_staff(mydb,cart):
print('\t\t*-----SignUp For Staff-----*\t\t')
is_staff=1
is_admin=0
f_name = input('ENTER FULL NAME: ')
mycursor2 = [Link]()
[Link]('select username from users')
names = [Link]()
while True:
u_name = input('ENTER USERNAME: ')
check = (u_name,)
if check in names:
print("USERNAME EXISTS")
else:
while True:
password2 = input('ENTER PASSWORD')
password1 = input('ENTER PASSWORD AGAIN')
if password2 == password1:
sql1 = "INSERT INTO users(username, full_name, password, is_staff, is_admin)
VALUES('{}','{}','{}',{},{})".format(u_name,f_name,password2,is_staff,is_admin)
mycursor = [Link]()
[Link](sql1)
[Link]()
break
else:
print('PASSWORD DOES NOT MATCH')
break
print("SIGNIN SUCCESSFUL")
z=input('Press ENTER to login')
login(mydb,cart)
def signup_admin(mydb,cart):
print('\t\t*-----SignUp For Admin-----*\t\t')
is_staff=0
is_admin=1
f_name = input('ENTER FULL NAME: ')
mycursor2 = [Link]()
[Link]('select username from users')
names = [Link]()
while True:
u_name = input('ENTER USERNAME: ')
check = (u_name,)
if check in names:
print("USERNAME EXISTS")
else:
while True:
password2 = input('ENTER PASSWORD')
password1 = input('ENTER PASSWORD AGAIN')
if password2 == password1:
sql1 = "INSERT INTO users(username, full_name, password, is_staff, is_admin)
VALUES('{}','{}','{}',{},{})".format(u_name,f_name,password2,is_staff,is_admin)
mycursor = [Link]()
[Link](sql1)
[Link]()
break
else:
print('PASSWORD DOES NOT MATCH')
break
print("ADMIN SIGNIN SUCCESSFUL")
z=input('Press ENTER to login')
login(mydb,cart)
def login(mydb,cart):
print('\t\t*-----Login-----*\t\t')
mycursor = [Link]()
[Link]("select username from users")
u_name=[Link]()
[Link]("select password from users")
passwd=[Link]()
[Link]("select username from users where is_admin like 1 ")
data=[Link]()
data2=[]
for i in data:
[Link](i)
s1=[x[0] for x in data2]
[Link]("select username from users where is_staff like 1 ")
rec=[Link]()
rec1=[]
for i in rec:
[Link](i)
s2=[x[0] for x in rec1]
u_names2 =[]
password2 = []
users={}
for i in u_name:
u_names2.append(i[0])
for i in passwd:
[Link](i[0])
for i in range(len(u_names2)):
users[u_names2[i]]=password2[i]
while True:
uname=input("enter username")
if uname not in u_names2:
print("username doesnot exist")
choice=int(input('Enter 1 to signup as STAFF and Enter 2 to signup as ADMIN or
enter 3 to log in'))
if choice == 1:
signup_staff(mydb,cart)
login(mydb,cart)
elif choice==3:
login(mydb,cart)
else:
signup_admin(mydb,cart)
login(mydb,cart)
else:
while True:
p_word = input('Enter Password: ')
check_p = users[uname]
if p_word != check_p:
print('INCORRECT PASSWORD')
else:
print('Login Successful')
print("!!!!!!!!!!!!!!!!!!WELCOME TO THIS MEDICAL SHOP
SOFTWARE!!!!!!!!!!!!!!")
if uname in s1:
home1(mydb,cart)
else:
home(mydb,cart)
break
break
break
def update_medi(mydb):
mycur=[Link]()
name=input("enter medicine name")
price=float(input("enter new price"))
quantity=int(input("enter quantity"))
exp_date=input("enter expiry date")
sql2="UPDATE medicines SET price={}, quantity={}, expiry_date='{}' WHERE
medi_name='{}'".format(price, quantity, exp_date,name)
[Link](sql2)
[Link]()
print("details of {} successfully updated".format(name))
home(mydb,cart)
def add_medicine(mydb):
mycur = [Link]()
data=[]
sql="select * from medicines"
[Link](sql)
res=[Link]()
for i in res:
[Link](i[1])
m_name = input('Medicine name')
if m_name in data:
print("given medicine already exists")
choice=input("enter 1 to update this medicine and enter 2 to add another medicine")
if choice=='1':
update_medi(mydb)
else:
add_medicine(mydb)
else:
price1 = input('Rate')
quantity2= input('Quantity')
expdate=input('Expirydate [yyyy-mm-dd]')
sql1 = "INSERT INTO medicines(medi_name, price, quantity,expiry_date)
VALUES('{}',{},{},'{}')".format(m_name,price1,quantity2,expdate)
[Link](sql1)
[Link]()
print ( 'Data entered successfully.' )
home(mydb,cart)
def startup(mydb):
add_medicine()
def view_stock(mydb):
mycursor = [Link]()
stock = {}
[Link]('select * from medicines')
stocks = [Link]()
fields=['Medicine ID','Medicine Name', 'Rate', 'Quantity', 'Expiry Date']
for i in stocks:
medicine_info=[]
for j in range(len(i)):
medicine_info.append(i[j])
stock[i[0]]=medicine_info
print('Medicine Id\t|\tName\t|\tRate\t|\tQuantity\t|\tExpiry Date\t|\t')
print(' \t|\t \t|\t \t|\t \t|\t \t|\t')
for i in stock:
temp=stock[i]
for j in temp:
print(j,end='\t\t')
home(mydb,cart)
return stock
def delete_medi(mydb):
mycur = [Link]()
name=input("enter the name of the medicine you want to delete:")
sql="DELETE FROM medicines WHERE medi_name='{}'".format(name)
[Link](sql)
[Link]()
print("deleted item '{}' successfully".format(name))
home(mydb,cart)
def search_medicine(mydb,cart):
mycursor = [Link]()
while True:
search = input('Enter name of medicine to search for : ')
search = [Link]()
if search == 'home':
home(mydb,cart)
sql1 = "SELECT * FROM medicines WHERE medi_name LIKE '{}'".format(search)
[Link](sql1)
med_info = [Link]()
if len(med_info)<=0:
print('No such medicine in stock')
z=int(input('Enter 1 to request medicine or Enter 2 to do to Home'))
if z==1:
request_medicine(mydb,cart)
break
else:
home(mydb,cart)
else:
stock = {}
fields=['Medicine ID','Medicine Name', 'Rate', 'Quantity', 'Expiry Date']
for i in med_info:
medicine_info=[]
for j in range(len(i)):
medicine_info.append(i[j])
stock[i[0]]=medicine_info
print('Medicine Id\t|\tName\t|\tRate\t|\tQuantity\t|\tQExpiry Date\t|\t')
print(' \t|\t \t|\t \t|\t \t|\t \t|')
for i in stock:
temp=stock[i]
for j in temp:
print(j,end='\t\t')
temp = int(input('Enter 1 to buy medicine or Enter 2 to exit '))
if temp==1:
buy_medicine(mydb,med_info,cart)
home(mydb,cart)
else:
home(mydb,cart)
break
def request_medicine(mydb,cart):
mycursor = [Link]()
req_medicine =input("REQUEST THE MEDICINE NOT IN STOCK:")
quantity=int(input("enter the quantity you require:"))
sql1 = "INSERT INTO medicine_requests(medi_name,quantity) VALUES('{}',
{})".format(req_medicine,quantity)
[Link](sql1)
[Link]()
print('Medicine Requested')
home(mydb,cart)
def view_requests(mydb,cart):
mycursor = [Link]()
[Link]('SELECT * FROM medicine_requests')
all_requests = [Link]() print('Request_ID\t\t|\
tMedicine Name\t\t|\tQuantity Required') for i in all_requests:
for j in range(len(i)):
print(i[j],end='\t\t|\t')
z=input('press ENTER to go Home')
home(mydb,cart)
def buy_medicine(mydb,med,cart):
for i in med:
med_id = i[0]
med_name = i[1]
med_rate = i[2]
med_quantity = i[3]
med_edate = i[4]
while True:
req = int(input("How many packets do you require: "))
if req<=med_quantity:
total = med_rate*req
print('Total Price: ',total)
buy_info = [med_id,med_name,med_rate,req,total]
temp = int(input('Enter 1 to add to cart or Enter 2 to change quantity: '))
if temp==1:
[Link](buy_info)
temp2 = int(input('Enter 1 to proceed to checkout or Enter 2 to buy other
medicines: '))
if temp2 == 1:
buyout(mydb,cart)
elif temp2== 2:
search_medicine(mydb,cart)
else:
if z==1:
med = search
quantity = int(input('Enter how much you want'))
request_medicine(mydb, med, quantity)
break
else:
home(mydb)
def create_bill(filename,date,name,i_no,data,total_amount):
pdf = [Link](filename)
[Link]('bill')
med_name=[]
for i in data:
med_name.append(i[1])
[Link]("Times-Roman", 28)
[Link](200,750,'Medical Store')
[Link]("Times-Roman", 25)
[Link](250,720,'BILL')
[Link]("Times-Roman", 13)
[Link](450,720,date)
[Link]("Times-Roman", 18)
[Link](50,660,name)
[Link](50,640,i_no)
[Link](50,550, 'Medicine ID |')
[Link](170,550, 'Medicine Name |')
[Link](310,550, 'Rate |')
[Link](370,550, 'Quantity |')
[Link](450,550, 'Price')
for i in range(50,500,10):
[Link](i,570, '-')
[Link](i,530, '-')
[Link]("Times-Roman", 15)
pos=[70,200,330,390,470]
y=500
for i in data:
for j in range(5):
[Link](pos[j],y, str(i[j]))
y-=30
[Link](250,150,'Total amount: ')
[Link](350,150,str(total_amount))
[Link]()
print("Bill created and saved to folder")
z=str(input("DO YOU WANT TO PRINT THE RECIEPT?( Y / N ):"))
if z=="y":
print( )
print("""
RECEIPT
...........
MEDICINE NAME:""", end=" ")
for i in med_name:
print(i,end=" , ")
print( """\t\t CUSTOMER NAME:""", name)
print(" TOTAL PRICE :", total_amount)
def buyout(mydb, cart):
print(cart)
mycursor2 = [Link]()
[Link]('SELECT * FROM sold_items')
inv = [Link]()
n = len(inv)
Current_Date = [Link]()
c_date = str(Current_Date)
c_date3 = c_date[0:10]
c_date1 = c_date3.replace('-','_')
c_date2 = c_date[11:20]
c_date2 = c_date2.replace(':','_')
file_name = c_date1 + '_' + c_date2 + '_' + 'bill'
file_name = file_name.replace('.','_') + '.pdf'
date = c_date[0:20]
name=input('Enter Name of the customer: ')
i_no = 'Invoice Number: '+ str(n+1)
total = 0
for i in cart:
total+=i[4]
create_bill(file_name,date,name,i_no,cart,total)
mycursor = [Link]()
for i in cart:
[Link]("INSERT INTO sold_items(sold_on, sold_to, medicine_id,
quantity_sold, price) VALUES('{}','{}',{},{},{})".format(c_date3,name,i[0],i[3],i[4]))
[Link]("UPDATE medicines SET quantity = quantity - {} WHERE medi_id
= {} ".format(i[3],i[0]))
print('Item Successfully Sold')
[Link]()
x=input('Press ENTER to go to home')
home(mydb,cart)
def view_cart(cart):
print('Items in Cart')
print('\tMedicine Name |\t\tQuantity |\t\tPrice |')
for i in cart:
print('\t',i[1],'\t\t',i[3],'\t\t',i[4])
home(mydb,cart)
def all_list():
choice=input("[Link] you want to enter medicine detail. [Link] medicine detail")
if choice=='1':
f=open("[Link]","a")
ch='y'
while ch=='y' or ch=='Y':
name=input("enter the name of medicine")
price=int(input("enter price"))
use=input("enter use:")
[Link](name)
[Link]("\t\t\t\t")
[Link](str(price))
[Link]("\t")
[Link](use)
[Link]("\n")
ch=input("do you want to enter more(y/n)")
[Link]()
else:
f=open("[Link]","r")
s=[Link]()
print("===========================MEDICINE
DETAILS==============================")
print(" name","\t\t\t"," price","\t\t\t"," uses")
print("---------","\t\t\t"," ----------","\t\t\t","------------")
for i in s:
print(i,end="\n ")
home(mydb,cart)
def exit():
z=input('Press ENTER to EXIT')
'''
++++++++++++++++++++++++++++admin++++++++++++++++++++
'''
def update_medi1(mydb):
mycur=[Link]()
name=input("enter medicine name")
price=float(input("enter new price"))
quantity=int(input("enter quantity"))
exp_date=input("enter expiry date")
sql2="UPDATE medicines SET price={}, quantity={}, expiry_date='{}' WHERE
medi_name='{}'".format(price, quantity, exp_date,name)
[Link](sql2)
[Link]()
print("details of {} successfully updated".format(name))
home1(mydb,cart)
def add_medicine1(mydb):
mycur = [Link]()
data=[]
sql="select * from medicines"
[Link](sql)
res=[Link]()
for i in res:
[Link](i[1])
m_name = input('Medicine name')
if m_name in data:
print("given medicine already exists")
choice=input("enter 1 to update this medicine and enter 2 to add another medicine")
if choice=='1':
update_medi1(mydb)
else:
add_medicine1(mydb)
else:
price1 = input('Rate')
quantity2= input('Quantity')
expdate=input('Expirydate [yyyy-mm-dd]')
sql1 = "INSERT INTO medicines(medi_name, price, quantity,expiry_date)
VALUES('{}',{},{},'{}')".format(m_name,price1,quantity2,expdate)
[Link](sql1)
[Link]()
print ( 'Data entered successfully.' )
home1(mydb,cart)
def startup(mydb):
add_medicine1()
def view_stock1(mydb):
mycursor = [Link]()
stock = {}
[Link]('select * from medicines')
stocks = [Link]()
fields=['Medicine ID','Medicine Name', 'Rate', 'Quantity', 'Expiry Date']
for i in stocks:
medicine_info=[]
for j in range(len(i)):
medicine_info.append(i[j])
stock[i[0]]=medicine_info
print('Medicine Id\t|\tName\t|\tRate\t|\tQuantity\t|\tExpiry Date\t|\t')
print(' \t|\t \t|\t \t|\t \t|\t \t|\t')
for i in stock:
temp=stock[i]
for j in temp:
print(j,end='\t\t')
home1(mydb,cart)
return stock
def delete_medi1(mydb):
mycur = [Link]()
name=input("enter the name of the medicine you want to delete:")
sql="DELETE FROM medicines WHERE medi_name='{}'".format(name)
[Link](sql)
[Link]()
print("deleted item '{}' successfully".format(name))
home1(mydb,cart)
def search_medicine1(mydb,cart):
mycursor = [Link]()
while True:
search = input('Enter name of medicine to search for : ')
search = [Link]()
if search == 'home':
home1(mydb,cart)
sql1 = "SELECT * FROM medicines WHERE medi_name LIKE '{}'".format(search)
[Link](sql1)
med_info = [Link]()
if len(med_info)<=0:
print('No such medicine in stock')
z=int(input('Enter 1 to request medicine or Enter 2 to do to Home'))
if z==1:
request_medicine1(mydb,cart)
break
else:
home1(mydb,cart)
else:
stock = {}
fields=['Medicine ID','Medicine Name', 'Rate', 'Quantity', 'Expiry Date']
for i in med_info:
medicine_info=[]
for j in range(len(i)):
medicine_info.append(i[j])
stock[i[0]]=medicine_info
print('Medicine Id\t|\tName\t|\tRate\t|\tQuantity\t|\tQExpiry Date\t|\t')
print(' \t|\t \t|\t \t|\t \t|\t \t|')
for i in stock:
temp=stock[i]
for j in temp:
print(j,end='\t\t')
temp = int(input('Enter 1 to buy medicine or Enter 2 to exit '))
if temp==1:
buy_medicine1(mydb,med_info,cart)
home1(mydb,cart)
else:
home1(mydb,cart)
break
def request_medicine1(mydb,cart):
mycursor = [Link]()
req_medicine =input("REQUEST THE MEDICINE NOT IN STOCK:")
quantity=int(input("enter the quantity you require:"))
sql1 = "INSERT INTO medicine_requests(medi_name,quantity) VALUES('{}',
{})".format(req_medicine,quantity)
[Link](sql1)
[Link]()
print('Medicine Requested')
home1(mydb,cart)
def view_requests1(mydb,cart):
mycursor = [Link]()
[Link]('SELECT * FROM medicine_requests')
all_requests = [Link]() print('Request_ID\t\t|\
tMedicine Name\t\t|\tQuantity Required') for i in all_requests:
for j in range(len(i)):
print(i[j],end='\t\t|\t')
z=input('press ENTER to go Home')
home1(mydb,cart)
def buy_medicine1(mydb,med,cart):
for i in med:
med_id = i[0]
med_name = i[1]
med_rate = i[2]
med_quantity = i[3]
med_edate = i[4]
while True:
req = int(input("How many packets do you require: "))
if req<=med_quantity:
total = med_rate*req
print('Total Price: ',total)
buy_info = [med_id,med_name,med_rate,req,total]
temp = int(input('Enter 1 to add to cart or Enter 2 to change quantity: '))
if temp==1:
[Link](buy_info)
temp2 = int(input('Enter 1 to proceed to checkout or Enter 2 to buy other
medicines: '))
if temp2 == 1:
buyout(mydb,cart)
elif temp2== 2:
search_medicine(mydb,cart)
else:
if z==1:
med = search
quantity = int(input('Enter how much you want'))
request_medicine(mydb, med, quantity)
break
else:
home1(mydb)
def create_bill1(filename,date,name,i_no,data,total_amount):
pdf = [Link](filename)
[Link]('bill')
med_name=[]
for i in data:
med_name.append(i[1])
[Link]("Times-Roman", 28)
[Link](200,750,'Medical Store')
[Link]("Times-Roman", 25)
[Link](250,720,'BILL')
[Link]("Times-Roman", 13)
[Link](450,720,date)
[Link]("Times-Roman", 18)
[Link](50,660,name)
[Link](50,640,i_no)
[Link](50,550, 'Medicine ID |')
[Link](170,550, 'Medicine Name |')
[Link](310,550, 'Rate |')
[Link](370,550, 'Quantity |')
[Link](450,550, 'Price')
for i in range(50,500,10):
[Link](i,570, '-')
[Link](i,530, '-')
[Link]("Times-Roman", 15)
pos=[70,200,330,390,470]
y=500
for i in data:
for j in range(5):
[Link](pos[j],y, str(i[j]))
y-=30
[Link](250,150,'Total amount: ')
[Link](350,150,str(total_amount))
[Link]()
print("Bill created and saved to folder")
z=str(input("DO YOU WANT TO PRINT THE RECIEPT?( Y / N ):"))
if z=="y":
print( )
print("""
RECEIPT
...........
MEDICINE NAME:""", end=" ")
for i in med_name:
print(i,end=" ")
print( """\t\t CUSTOMER NAME:""", name)
print(" TOTAL PRICE :", total_amount)
def buyout1(mydb, cart):
print(cart)
mycursor2 = [Link]()
[Link]('SELECT * FROM sold_items')
inv = [Link]()
n = len(inv)
Current_Date = [Link]()
c_date = str(Current_Date)
c_date3 = c_date[0:10]
c_date1 = c_date3.replace('-','_')
c_date2 = c_date[11:20]
c_date2 = c_date2.replace(':','_')
file_name = c_date1 + '_' + c_date2 + '_' + 'bill'
file_name = file_name.replace('.','_') + '.pdf'
date = c_date[0:20]
name=input('Enter Name of the customer: ')
i_no = 'Invoice Number: '+ str(n+1)
total = 0
for i in cart:
total+=i[4]
create_bill1(file_name,date,name,i_no,cart,total)
mycursor = [Link]()
for i in cart:
[Link]("INSERT INTO sold_items(sold_on, sold_to, medicine_id,
quantity_sold, price) VALUES('{}','{}',{},{},{})".format(c_date3,name,i[0],i[3],i[4]))
[Link]("UPDATE medicines SET quantity = quantity - {} WHERE medi_id
= {} ".format(i[3],i[0]))
print('Item Successfully Sold')
[Link]()
x=input('Press ENTER to go to home')
home1(mydb,cart)
def view_cart1(cart):
print('Items in Cart')
print('\tMedicine Name |\t\tQuantity |\t\tPrice |')
for i in cart:
print('\t',i[1],'\t\t',i[3],'\t\t',i[4])
home(mydb,cart)
def all_list1():
choice=input("[Link] you want to enter medicine detail. [Link] medicine detail")
if choice=='1':
f=open("[Link]","a")
ch='y'
while ch=='y' or ch=='Y':
name=input("enter the name of medicine")
price=int(input("enter price"))
[Link](name)
[Link]("\t")
[Link](str(price))
[Link]("\n")
ch=input("do you want to enter more(y/n)")
[Link]()
else:
f=open("[Link]","r")
s=[Link]()
print("===========================MEDICINE
DETAILS==============================")
print(" name","\t\t\t"," price","\t\t\t"," uses")
print("---------","\t\t\t"," ----------","\t\t\t","------------")
for i in s:
print(i,end="\n ")
home1(mydb,cart)
def remove_staff1(mydb):
mycur = [Link]()
name=input("enter the username of the staff to be removed")
sql="DELETE FROM users WHERE username='{}'".format(name)
[Link](sql)
[Link]()
print("staff '{}' fired successfully".format(name))
home1(mydb,cart)
mydb=sql_connection()
cart=[]
print('\t\t\t Medical Store')
print('''\t
\ /
=========================================================
| |
| \ / | | | | | |\ /| | |
| \ /\ / |-- | | | | | \/ | |-- |
| \/ \/ | | | | | | || |
| |
| |
| | | | |
| | | | |
| | | | |
| |
| |
| | | | | /\ | | |\ /| /\ | \ / |
| | |---| /--\ |\ | \/ | /--\ | \ / |
| | | |/ \ | \ | | / \ | | |
| |
=========================================================
/ \
''')
XYZ=input(" ----------PRESS ENTER TO CONTINUE---------------")
WELCOME=input("Enter L for login or S for signup or Q for quit:")
if WELCOME== "L" or WELCOME== "l":
login(mydb,cart)
elif WELCOME== "S" or WELCOME=="s":
choice=int(input('Enter 1 to signup as STAFF and Enter 2 to signup as ADMIN '))
if choice == 1:
signup_staff(mydb,cart)
login(mydb,cart)
else:
signup_admin(mydb,cart)
login(mydb,cart)
else:
print("byeeeeeeeeeeeeeee :)")
x=input("HAVE A GREAT DAY AHEAD!!!!! :)")
x=input('Exit')
Output:
CONCLUSION:
The Pharmacy Management System provides a
streamlined digital platform to manage medicines,
sales, and inventory efficiently. It simplifies
record keeping, stock tracking, and billing
processes while improving communication
between pharmacists and customers. The project
effectively demonstrates Python-MySQL
integration and basic CRUD (Create, Read,
Update, Delete) operations for managing
medicines, suppliers, and transactions.
BIBLIOGRAPHY
NCERT
Geeks for geeks data module
Is coding free to learn? - LEAD School