Project Documentation
Project Documentation
Project Documentation
SESSION : 2022 – 23
Hospital Management.
proper direction.
Eva Verma
XII - B
CERTIFICATE
Contents:
1. Python History and Versions
2. Python Features
3. Program Listing
4. Outputs
5. Conclusion
6. Bibliography
Python History and Latest Version
o Python laid its foundation in the late 1980s.
o ABC language.
o Modula-3
Van Rossum wanted to select a name which unique, sort, and little-bit mysterious.
So he decided to select naming Python after the "Monty Python's Flying
Circus" for their newly created programming language.
Python 1.4, documentation released on 25 October 1996.
Python Features
Python provides many useful features which make it popular and valuable from the
other programming languages. It supports object-oriented programming, procedural
programming approaches and provides dynamic memory allocation. We have listed
below a few essential features.
2) Expressive Language
Python can perform complex tasks using a few lines of code. A simple example, the
hello world program you simply type print("Hello World"). It will take only one
line to execute, while Java or C takes multiple lines.
3) Interpreted Language
Python is an interpreted language; it means the Python program is executed one
line at a time. The advantage of being interpreted language, it makes debugging
easy and portable.
4) Cross-platform Language
Python can run equally on different platforms such as Windows, Linux, UNIX, and
Macintosh, etc. So, we can say that Python is a portable language. It enables
programmers to develop the software for several competing platforms by writing a
program only once.
6) Object-Oriented Language
Python supports object-oriented language and concepts of classes and objects come
into existence. It supports inheritance, polymorphism, and encapsulation, etc. The
object-oriented procedure helps to programmer to write reusable code and develop
applications in less code.
7) Extensible
It implies that other languages such as C/C++ can be used to compile the code and
thus it can be used further in our Python code. It converts the program into byte
code, and any platform can use that byte code.
10) Integrated
It can be easily integrated with languages like C, C++, and JAVA, etc. Python runs
code line by line like C,C++ Java. It makes easy to debug the code.
11) Embeddable
The code of the other programming language can use in the Python source code. We
can use Python source code in another programming language as well. It can embed
other language into our code.
Python is also versatile and widely used in every technical field, such as Machine
Learning, Artificial Intelligence, Web Development, Mobile Application, Desktop
Application, Scientific Calculation, etc.
PROGRAM
LISTING
##hospital management software
##PRINTING WELCOME NOTE
while(True):
print("""\
n=======================================================
========\n
WELCOME TO KK HOSPITAL PVT. LTD.\n
\
n=======================================================
========
""")
##creating database connectivity
import mysql.connector
psw=str(input("ENTER THE DATABASE PASSWORD;"))
mysql=mysql.connector.connect(host="localhost",user="root",pass
wd=psw)
mycursor=mysql.cursor()
#creating database
mycursor.execute("create database if not exists kvk_hospitals")
mycursor.execute("use kvk_hospitals")
#creating the tables we need
mycursor.execute("create table if not exists patient_details(puid
int(10) primary key,name varchar(30) not null,age int(3),address
varchar(50),doctor_recommended varchar(30))")
mycursor.execute("create table if not exists doctor_details(name
varchar(30) primary key,specialisation varchar(40),age
int(2),address varchar(30),contact varchar(15),fees
int(10),monthly_salary int(10))")
mycursor.execute("create table if not exists nurse_details(name
varchar(30) primary key,age int(2),address varchar(30),contact
varchar(15),monthly_salary int(10))")
mycursor.execute("create table if not exists
other_workers_details(name varchar(30) primary key,age
int(2),address varchar(30),contact varchar(15),monthly_salary
int(10))")
#login or signup option
#creating table for storing the username and password of the
user
mycursor.execute("create table if not exists user_data(username
varchar(30) primary key,password varchar(30) default'000')")
#printing option
while(True):
print("""
1. SIGN IN (LOGIN)
2. SIGN UP (REGISTER)
""")
========================================================
=========================
""")
u=input("ENTER YOUR PREFERRED USERNAME!!:")
p=input("ENTER YOUR PREFERRED PASSWORD (PASSWORD
SHOULD BE STRONG!!!:")
#ENTERING THE ENTERED VALUE TO THE USER_DATA TABLE
mycursor.execute("insert into user_data
values('"+u+"','"+p+"')")
mysql.commit()
print("""
========================================================
=========================
!!!!!!!!!!!!!!!!!!!!!!!!!!!REGISTERED
SUCCESSFULLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================
=========================
""")
x=input("enter any key to continue:")
#IF USER WANTS TO LOGIN
elif r==1:
print("""
========================================================
=========================
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! {{SIGN
IN }} !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================
=========================
""")
un=input("ENTER THE USERNAME!!:")
ps=input("ENTER THE PASSWORD!!:")
""")
k=["NAME","SPECIALISATION","AGE","ADDRESS","CONTACT","FEE
S","MONTHLY_SALARY"]
d=dict(zip(k,v))
print(d)
#if user wants to see the details of nurses
elif c==2:
mycursor.execute("select * from
nurse_details")
row=mycursor.fetchall()
for i in row:
v=list(i)
k=["NAME","SPECIALISATION","AGE","ADDRESS","CONTACT","MO
NTHLY_SALARY"]
d=dict(zip(k,v))
print(d)
#if user wants to see the details of
other_workers
elif c==3:
mycursor.execute("select * from
other_workers_details")
row=mycursor.fetchall()
for i in row:
v=list(i)
k=["NAME","SPECIALISATION","AGE","ADDRESS","CONTACT","MO
NTHLY_SALARY"]
d=dict(zip(k,v))
print(d)
#IF USER WANTS TO ENTER DETAILS
elif b==2:
print("""
1. DOCTOR DETAILS
2. NURSE DETAILS
3. OTHER WORKERS
""")
c=int(input("ENTER YOUR CHOICE:"))
#FOR ENTERING DETAILS OF DOCTORS
if c==1:
#ASKING THE DETAILS
name=input("ENTER DR. NAME:")
spe=input("ENTER SPECIALISATION:")
age=input("ENTER AGE:")
add=input("ENTER ADDRESS:")
cont=input("ENTER CONTACT NO.:")
fees=input("ENTER FEES:")
ms=input("ENTER MONTHLY_SALARY:")
#INSERTING VALUES ENTERED INTO THE
DOCTORS_TABLE
mycursor.execute("insert into doctor_details
values('"+name+"','"+spe+"','"+age+"','"+add+"','"+cont+"','"+fees+
"','"+ms+"')")
mysql.commit()
print("SUCCESSFULLY ADDED")
#for entering nurse details
elif c==2:
#ASKING THE DETAILS
name=input("ENTER NURSE NAME:")
age=input("ENTER AGE:")
add=input("ENTER ADDRESS:")
cont=input("ENTER CONTACT NO.:")
ms=int(input("ENTER MONTHLY_SALARY:"))
#INSERTING VALUES ENTERED TO THE TABLE
mycursor.execute("insert into nurse_details
values('"+name+"','"+age+"','"+add+"','"+cont+"','"+str(ms)+"')")
mysql.commit()
print("SUCCESSFULLY ADDED")
#for entering workers details
elif c==3:
#ASKING THE DETAILS
name=input("ENTER WORKER NAME:")
age=input("ENTER AGE:")
add=input("ENTER ADDRESS:")
cont=input("ENTER CONTACT NO.:")
ms=input("ENTER MONTHLY_SALARY:")
#INSERTING VALUES ENTERED TO THE TABLE
mycursor.execute("insert into
other_workers_details
values('"+name+"','"+age+"','"+add+"','"+cont+"','"+ms+"')")
mysql.commit()
print("SUCCESSFULLY ADDED")
#if unser wants to delete data
elif b==3:
print("""
1. DOCTOR DETAILS
2. NURSE DETAILS
3. OTHER WORKERS
""")
c=int(input("ENTER YOUR CHOICE:"))
#deleting doctor's details
if c==1:
name=input("ENTER DOCTOR'S NAME:")
mycursor.execute("select * from
doctor_details where name=='"+name+"'")
row=mycursor.fetchall()
print(row)
p=input("you really wanna delete this data?
(y/n):")
if p=="y":
mycursor.execute("delete from
doctor_details where name='"+name+"'")
mysql.commit()
print("SUCCESSFULLY DELETED!!")
else:
print("NOT DELETED")
print("""
1. SHOW PATIENT DETAILS
2. ADD NEW PATIENT
3. DISCHARGE PATIENT
4. EXIT
""")
b=int(input("ENTER YOUR CHOICE:"))
#showing the existing details
#if user wants to see the details of PATIENT
if b==1:
mycursor.execute("select * from
patient_details")
row=mycursor.fetchall()
for i in row:
b=0
v=list(i)
k=["NAME","SEX","AGE","ADDRESS","CONTACT"]
d=dict(zip(k,v))
print(d)
========================================================
=========================
!!!!!!!!!!!!!!!!!!!!!!!!!!!REGISTERED
SUCCESSFULLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================
=========================
""")
#dischare process
elif b==3:
name=input("ENTER THE PATIENT NAME:")
mycursor.execute("select * from patient_details
where name='"+name+"'")
row=mycursor.fetchall()
print(row)
bill=input("HAS HE PAID ALL THE BILLS ? (y/n):")
if bill=="y":
mycursor.execute("delete from
patient_details where name='"+name+"'")
mysql.commit()
#if user wants to exit
elif b==4:
break
###SIGN OUT
elif a==3:
break
#IF THE USERNAME AND PASSWORD IS NOT IN THE
DATABASE
else:
break
OUTPUTS:
12345
CONCLUSION
Employee Records Management System can be
used to maintain the records easily. Achieving
this objective is difficult using the manual
system as the information is scattered, can be
redundant, and collecting relevant information
may be very time-consuming. All these
problems are solved by this project.
This system helps in maintaining the
information of pupils of the organization. It can
be easily accessed by the manager and kept safe
for a long period of time without any changes
BIBLIOGRAPHY
1. Computer Science With Python
(Sumita Arora)
2. Let Us Python
(Yashavant Kanetkar, Aditya
Kanetkar)
3. Basics of Python Programming
(Dr. Pratiyush Guleria)