Medical Store Management
Medical Store Management
Medical Store Management
SECONARY SCHOOL
Investigatory project of
Chemistry
STUDY OF OXALATE ION IN
GUAVA FRUIT
Submitted By : Submitted
To:
External Examiner
(Signature)
Date:
ACKNOWLEDGMENT
Class : XII B
Student name : Avtarit Dwivedi
Roll No :
Archies Higher Secondary School
600, Guruwakhera, Kanpur
CERTIFICATE
This is to certify that Avtarit Dwivedi of class XII has
prepared the report on the project entitle “ Oxalate Ion
in Guava Fruit “ . This report is the result of his efforts &
endeavors. The report is found worthy of acceptance as
final project report for the subject of Chemistry.
PROJECT CONTENTS
S.NO DESCRIPTION
1. Programming Language & Concept
4. Coading in Python
5. Output Screen
6. Bibiliography
Characteristics of Python
Following are important characteristics of Python Programming −
It supports functional and structured programming methods as well as
OOP.
It can be used as a scripting language or can be compiled to byte-code
for building large applications.
It provides very high-level dynamic data types and supports dynamic
type checking.
It supports automatic garbage collection.
It can be easily integrated with C, C++, COM, ActiveX, CORBA, and
Java.
Applications of Python
As mentioned before, Python is one of the most widely used language over
the web. I'm going to list few of them here:
Easy-to-learn − Python has few keywords, simple structure, and a
clearly defined syntax. This allows the student to pick up the language
quickly.
Easy-to-read − Python code is more clearly defined and visible to the
eyes.
Easy-to-maintain − Python's source code is fairly easy-to-maintain.
A broad standard library − Python's bulk of the library is very portable
and cross-platform compatible on UNIX, Windows, and Macintosh.
Interactive Mode − Python has support for an interactive mode which
allows interactive testing and debugging of snippets of code.
Portable − Python can run on a wide variety of hardware platforms and
has the same interface on all platforms.
Extendable − You can add low-level modules to the Python interpreter.
These modules enable programmers to add to or customize their tools
to be more efficient.
Databases − Python provides interfaces to all major commercial
databases.
GUI Programming − Python supports GUI applications that can be
created and ported to many system calls, libraries and windows
systems, such as Windows MFC, Macintosh, and the X Window
system of Unix.
Scalable − Python provides a better structure and support for large
programs than shell scripting.
Username – i.e., the username that you use to work with MySQL
Server. The default username for the MySQL database is a root
Password – Password is given by the user at the time of installing the
MySQL database. If you are using root then you won’t need the
password.
Host Name – is the server name or Ip address on which MySQL is
running. if you are running on localhost, then you can use localhost, or it’s
IP, i.e. 127.0.0.0
Database Name – Database name to which you want to connect. Here
we are using Database named ‘Electronics‘ because we have already
created this for our example.
Lists are one of the most powerful tools in python. They are just like the
arrays declared in other languages. But the most powerful thing is that list
need not be always homogenous. A single list can contain strings, integers,
as well as objects. Lists can also be used for implementing stacks and
queues. Lists are mutable, i.e., they can be altered once declared.
Tuples in Python
A tuple is a sequence of immutable Python objects. Tuples are just like lists
with the exception that tuples cannot be changed once declared. Tuples are
usually faster than lists.
Functions in Python
defevenOdd( x ):
if(x %2==0):
print"even"
else:
print"odd"
# Driver code
evenOdd(2)
evenOdd(3)
~~~~~~~~~
STRUCTURE OF DATABASE USED IN A
PROJECT
Database name : Medical
Table : med
Table : sales
Table : sales
1. Medicine section
4. Report Section
1. Issue books
2. Return Books
~~~~~~~~~~~
****************************** C O A D I N G **************************************
import os
import pymysql
conn=pymysql.connect(host='localhost',
user='root',passwd='123',db='medical')
cur=conn.cursor()
cur1=conn.cursor()
def menu1():
os.system('cls')
print("----------- MEDICAL-STORE-MANAGEMENT-SYSTEM---------------")
print("---------------------------------------")
if choice1==1:
menu2()
if choice1==3:
purchase_entry()
if choice1==2:
menu3()
menu1()
if choice1==4:
menu4()
menu1()
def menu2():
print("----------------------------------------------------")
if choice2==1:
create_medicine()
menu2()
if choice2==2:
edit_medicine()
if choice2==3:
remove_med()
menu2()
if choice2==4:
menu1()
def menu3():
os.system('cls')
print("----------- SALES-MANAGEMENT-SYSTEM---------------")
print("---------------------------------------")
if choice3==1:
sales_entry()
menu3()
if choice3==2:
sales_return()
t=input("Press any key to back to menu ")
menu3()
def menu4():
os.system('cls')
print("----------- REPORT-MANAGEMENT-SYSTEM---------------")
print("---------------------------------------")
if choice4==1:
medicine_list()
if choice4==2:
sales_report()
if choice4==3:
purchase_report()
def medicine_list():
print("-------------------------------------------------------------------------")
print("{0:^10}{1:^15}{2:^20}{3:^15}{4:^15}".format("medicine-
no","med-name","batch-no",
"stock(Tabs)","rate(Rs)"))
print("-------------------------------------------------------------------------")
s1=("select * from med")
cur.execute(s1)
print("{0:^10}{1:^15}{2:^20}{3:^15}
{4:^15}".format(mno,mname,mbno,mstock,mrate))
print("-------------------------------------------------------------------------")
def medicine_list():
print("-------------------------------------------------------------------------")
print("{0:^10}{1:^15}{2:^20}{3:^15}{4:^15}".format("medicine-
no","med-name","batch-no",
"stock(Tabs)","rate(Rs)"))
print("-------------------------------------------------------------------------")
cur.execute(s1)
print("{0:^10}{1:^15}{2:^20}{3:^15}
{4:^15}".format(mno,mname,mbno,mstock,mrate))
print("-------------------------------------------------------------------------")
def sales_report():
print("-------------------------------------------------------------------------")
print("{0:^10}{1:^15}{2:^20}{3:^15}{4:^15}".format("Invoice-No","Inv-
date","Med-Name",
"Quantity(Tabs)","Amount(Rs)"))
print("-------------------------------------------------------------------------")
cur.execute(s1)
d2=(mmno)
cur1.execute(s2,d2)
r=cur1.fetchone()
print("{0:^10}{1:^15}{2:^20}{3:^15}
{4:^15}".format(mino,str(midate),r[1],mqty,mamt))
print("-------------------------------------------------------------------------")
def purchase_report():
print("-------------------------------------------------------------------------")
print("{0:^10}{1:^15}{2:^20}{3:^15}".format("Invoice-No","Product-
Name",
"Quantity(Tabs)","Purchase-date"))
print("-------------------------------------------------------------------------")
cur.execute(s1)
d2=(mbno)
cur1.execute(s2,d2)
r=cur1.fetchone()
print("{0:^10}{1:^15}{2:^20}
{3:^15}".format(mmno,r[1],mqty,str(mbdate)))
print("-------------------------------------------------------------------------")
def edit_medicine():
print("-------------- D E T A I L S ----------------------------")
d1=(mmno)
cur.execute(s1,d1)
r=cur.fetchone()
print(r)
print("--------------------------------------------------------------")
d1=(mbno,mstock,mrate,mmno)
cur.execute(s1,d1)
conn.commit()
mcont='Y'
while True:
print("-------------------------------------------------------------------")
if msave=="Y" or msave=="y":
d1=(mmno,mmname,mbno,mstock,mrate)
cur.execute(s1,d1)
conn.commit()
print("Record is saved.....")
if mcont=='N' or mcont=='n':
break
def remove_med():
d1=(mmno)
cur.execute(s1,d1)
r=cur.fetchone()
print(r)
print("--------------------------------------------------------------")
mans='y'
if mans=='y' or mans=='Y':
d1=(mmno)
cur.execute(s1,d1)
conn.commit()
def sales_return():
d1=(mino)
cur.execute(s1,d1)
rows=cur.fetchall()
for r in rows:
print(r)
d2=(int(r[2]))
cur.execute(s2,d2)
r1=cur.fetchone()
mstock=int(r1[3])+int(r[3])
d3=(mstock,int(r[2]))
cur.execute(s3,d3)
conn.commit()
d4=(mino)
cur.execute(s4,d4)
conn.commit()
d5=(mino)
cur.execute(s5,d5)
def sales_entry():
mcont='y'
midate=date.today()
gval=0.00
while True :
d1=(mmno)
cur.execute(s1,d1)
r=cur.fetchone()
mqty=int(input("Qty (Tabs):"))
mval=mqty*float(r[4])
print("Rate (Rs):%5.2f"%(float(r[4])))
gval=gval+mval
print("------------------------------------------")
d1=(mino,midate,mmno,mqty,mval)
cur.execute(s1,d1)
conn.commit()
mstock=int(r[3])-mqty
d1=(mstock,mmno)
cur.execute(s1,d1)
conn.commit()
if mcont=='N' or mcont=='n':
mgst=gval*0.12
d1=(mino,midate,mcust,gval,mgst)
cur.execute(s1,d1)
conn.commit()
break
def purchase_entry():
mcont='y'
midate=date.today()
print("-------------------------------------------------------------------")
gval=0.00
while True :
d1=(mmno)
cur.execute(s1,d1)
r=cur.fetchone()
mqty=int(input("Qty (Tabs):"))
mval=mqty*float(r[4])
print("Rate (Rs):%5.2f"%(float(r[4])))
print("------------------------------------------")
d1=(mino,mmno,mqty,midate)
cur.execute(s1,d1)
conn.commit()
mstock=int(r[3])+mqty
d1=(mstock,mmno)
cur.execute(s1,d1)
conn.commit()
def main():
menu1()
main()
No Book Name
1 Computer Science with Python ( Preeti Arora)