Python Project on School Management System for Class 12 IP/CS with Python CBSE Board Practical 2019-2020
# -------------------------------------------------------------------------
# * ** * Welcome to School Management System * * * *
# ------------------------------------------------------------------------
import main_menu
import admission
import student_data
import fee_details
import lib_details
while True:
# main_menu.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *")
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** ABC School - M A I N M E N U * * ** ")
print("1 : Admission")
print("2 : Student Data")
print("3 : Fees Details")
print("4 : Library Details ")
print("5 : Exit")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice :"))
if choice==1:
admission.ADM_MENU()
elif choice==2:
student_data.STU_MENU()
elif choice==3:
fee_details.FEE_MENU()
elif choice==4:
lib_details.LIB_MENU()
elif choice==5:
break
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to continue...")
import main_menu
import admission
def ADM_MENU():
while True:
admission.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** A D M I S S I O N M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Admission Details ")
print("2 : Show Admin_Details")
print("3 : Search ")
print("4 : Deletion")
print("5 : Update Admission Details")
print("6 : Return to MAIN MENU...")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :")) 1
if choice==1:
admission.Admin_details()
elif choice==2:
admission.Show_Admin_Details()
elif choice==3:
admission.Search_Admin_Details()
elif choice==4:
admission.Delete_Admin_Details()
elif choice==5:
admission.Edit_Admin_Details()
elif choice==6:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key return to MAIN - MENU..")
import main_menu
import student_data
def STU_MENU(): #student_data.py module
while True:
student_data.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT DATA M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Add Student Record ")
print("2 : Show Student Details")
print("3 : Search Student Record")
print("4 : Delete Student Record ")
print("5 : Edit Student Record ")
print("6 : Return")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :"))
if choice==1:
student_data.Add_Records()
elif choice==2:
student_data.Show_Stu_Details()
elif choice==3:
student_data.Search_Stu_Details()
elif choice==4:
student_data.Delete_Stu_Details()
elif choice==5:
student_data.Edit_Stu_Details()
elif choice==6:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
def FEE_MENU(): #fee_details.py module
while True:
fees_details.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT FEE M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Fee Deposit ")
print("2 : Fee Details")
print("3 : return to Main Menu..")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-3 :"))2
if choice==1:
fees_details.fees_Deposit()
elif choice==2:
fees_details.FDetails()
elif choice==3:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
import main_menu
import lib_details
def LIB_MENU(): #lib_details.py module
while True:
lib_details.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** Library M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Book Issue ")
print("2 : Book Return")
print("3 : return to Main Menu..")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-3 :"))
if choice==1:
lib_details.book_issue()
elif choice==2:
lib_details.book_return()
elif choice==3:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
import admission
import mysql.connector
def Admin_details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
adno=input("Enter Admission No ")
rollno=int(input("Enter Rollno :"))
sname=input("Enter Student Name :")
address=input("Enter Address :")
phone=input("Enter Phone No.")
class1=input("Enter Class")
Query=("Insert into admission values(%s,%d,%s,%s,%s,%s))
Record=(adno,rollno,sname,phone,class))
MyCur.execute(Query,Record)
MyCur.close()
MyCon.close()
print("Record has been Saved .. in Admission Data Table....")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
MyCon.close()
from mysql.connector import errorcode
from mysql.connector import(connection)
def Show_Admin_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
Query= (āSelect *from Admissionā)
MyCur.execute(Query)
for(adno,rollno,name,addres,class) in cursor:
print(āAdmission Codeā,adno)
print(āRoll Numberā,rollno)
print(āStudent Nameā,sname)
print(āAddressā,address)
print(āPhone Numberā,phone, āClassā,class)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#--------------------------------------------------------------------------------
def Search_Admin_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Admission
where temp_adno= ā%sā)
rec_srch=(temp_adno,)
MyCur.execute(Query,rec_srch)
for(adno,rollno,name,addres,class) in cursor:
print(āAdmission Codeā,adno)
print(āRoll Numberā,rollno)
print(āStudent Nameā,sname)
print(āAddressā,address)
print(āPhone Numberā,phone, āClassā,class)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#--------------------------------------------------------------------------------------
#admission.def delete_Admin_Details()
#--------------------------------------------------------------------------------------
def delete_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number
to be Delete :ā)
MyCur=mycon.cursor()
Query= (ā ā ā Delete from Admission
where adno= ā%sā)
rec_srch=(temp_adno,)
MyCur.execute(Query,rec_srch)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
print("Record has been deleted Now ")
#-------------------------------------------------------------------------------------------------
#admission.Edit_Admin_Details(): ADM_MENU() Choice=5
#-------------------------------------------------------------------------------------------------
def Edit_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number
to be Update / Edit :ā)
Query= (ā ā ā Select *from Admission
where temp_adno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_adno,)
print("Input New Data ")
sname=input("Enter Student Name :")
address=input("Enter Address :")
phone=input("Enter Phone No.")
class1=input("Enter Class")
Q=("Update admission set sname="%s",address="%s",
phone="%s",class1="%s", where temp_adno="%s")
D=(sname,address,phone,class1)
MyCur.execute(Q,D)
print("Record has been updated Now")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid
print("Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
""" print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** ABC School - M A I N M E N U * * ** ")
print("1 : Admission")
print("2 : Student Data")
print("3 : Fees Details")
print("4 : Library Details ")
print("5 : Exit")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice :")) 1
print("\n\t\t * * ** A D M I S S I O N M E N U * * ** ")
print("\t\t--------------------------------------------------")
print("1 : Admission Details ")
print("2 : Show Admin_Details")
print("3 : Search ")
print("4 : Deletion")
print("5 : Update Admission Details")
print("6 : Return to MAIN MENU...")
print("\t\t--------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :"))
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT DATA M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Add Student Record ")
print("2 : Show Student Details")
print("3 : Search Student Record")
print("4 : Delete Student Record ")
print("5 : Edit Student Record ")
print("6 : Return...")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :")) 1
#-----------------------------------------------------------------------------:-)
if choice==1:
student_data.Add_Records()
elif choice==2:
student_data.Show_Stu_Details()
elif choice==3:
student_data.Search_Stu_Details()
elif choice==4:
student_data.Delete_Stu_Details()
elif choice==5:
student_data.Edit_Stu_Details()
elif choice==6:
return
"""
#---------------------------------------------------------
# #1 Add Student Record | def Add_Records
#---------------------------------------------------------
import admission
import mysql.connector
import student_data
def Add_Records():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
rollno=int(input("Enter Rollno :"))
sname=input("Enter Student Name :")
add=input("Enter Address :")
Stream=input("Enter Stream:")
Query=("Insert into student_data
values(%s,%s,%s,%s)
Record=(rollno,sname,add,stream))
MyCur.execute(Query,Record)
MyCur.close()
MyCon.close()
print("Record has been Saved .. in Student Data Table....")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
MyCon.close()
#---------------------------------------------------------
# #2 Show Student Record | def Show_Stu_Details()
#---------------------------------------------------------
def Show_Stu_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
Query= (āSelect *from Student_Dataā)
MyCur.execute(Query)
for(rollno,sname,add,stream) in cursor:
print("Student Rollno ",rollno)
print("Student Name",name)
print("Address",add)
print("Stream",stream)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#-------------------------------------------------------------------------
# #3 Search Student Record | def Search_Stu_Details()
#---------------------------------------------------------------------
def Search_Stu_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Student_data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,add,stream) in cursor:
print("Student Rollno ",rollno)
print("Student Name",name)
print("Address",add)
print("Stream",stream)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#-------------------------------------------------------------------------
# #4 Delete Student Record | def Delete_Stu_Details()
#---------------------------------------------------------------------
def Delete_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number
to be Delete :ā)
MyCur=mycon.cursor()
Query= (ā ā ā Delete from Student_Data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
print("Record has been deleted Now ")
#-------------------------------------------------------------------
# #5 Edit Student Record | def Edit_Stu_Details()
#---------------------------------------------------------------------
def Edit_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number
to be Update / Edit :ā)
Query= (ā ā ā Select *from Student_Data
where temp_rollno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_rollno,)
print("Input New Data ")
name=input("Enter Student Name :")
add=input("Enter Address :")
stream=input("Enter Stream")
Q=("Update student_data set name="%s",add="%s",
stream="%s" where temp_rollno="%s")
D=(name,add,stream)
MyCur.execute(Q,D)
print("Record has been updated Now")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid
print("Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#------------------end of Student Data Menu ---------------------------------------
#-----------------------------------------------------------------------------------
# Learn
#
# print("\t\t-------------------------------------------------------------------------")
# print("\n\t\t * * ** STUDENT FEE M E N U * * ** ")
# print("\t\t-------------------------------------------------------------------------")
# print("1 : Fee Deposit ")
# print("2 : Fee Details")
# print("3 : return to Main Menu..")
#-----------------------------------------------------------------------------------
def Fee_Deposit():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number:ā)
Query= (ā ā ā Select *from Student_Data
where temp_rollno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_rollno,)
fees=int(input("Enter Deposit Fees"))
Q=("Update student_data set fees="%f"
where temp_rollno="%s")
D=(fees)
MyCur.execute(Q,D)
print(" ! Fees has been Deposited !")
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
#Fee Details
#----------------------------------------------------------------------------------------------
def Fee_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Student_data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1) in cursor:
print("Student Rollno",rollno)
print("Student Class ",class1)
print("Name & Fees" ,sname, Fees)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
# Next & Last MENU
#Library Details
#print("\t\t-------------------------------------------------------------------------")
#print("\n\t\t * * ** Library M E N U * * ** ")
#print("\t\t-------------------------------------------------------------------------")
#print("1 : Book Issue ")
#print("2 : Book Return")
#print("3 : return to Main Menu..")
#print("\t\t-------------------------------------------------------------------------")
#----------------------------------------------------------------------------------------------
def book_issue():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number :ā)
MyCur=mycon.cursor()
Query= (āSelect *from library
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1,bname,issuedate) in cursor:
print("Student Rollno",rollno)
print("Student Name ",name)
print("Book Name " ,bname)
print("Book Issue Date" ,issuedate)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
def book_return():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number :ā)
MyCur=mycon.cursor()
Query= (āSelect *from library
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1,bname,returndate) in cursor:
print("Student Rollno",rollno)
print("Student Name ",name)
print("Book Name " ,bname)
print("Book Return Date" ,returndate)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
# -- End of Project --------------------------#
download at
www.ramkohli.blogspot.in
#-------------------------------------------------------#
# Welcome to Study Tech Academy
#Python Project for Class 12 CBSE Board New Syllabus
#as per CBSE Guideline
# -------------------------------------------------------------------------
# * ** * Welcome to School Management System * * * *
# ------------------------------------------------------------------------
import main_menu
import admission
import student_data
import fee_details
import lib_details
while True:
# main_menu.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *")
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** ABC School - M A I N M E N U * * ** ")
print("1 : Admission")
print("2 : Student Data")
print("3 : Fees Details")
print("4 : Library Details ")
print("5 : Exit")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice :"))
if choice==1:
admission.ADM_MENU()
elif choice==2:
student_data.STU_MENU()
elif choice==3:
fee_details.FEE_MENU()
elif choice==4:
lib_details.LIB_MENU()
elif choice==5:
break
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to continue...")
import main_menu
import admission
def ADM_MENU():
while True:
admission.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** A D M I S S I O N M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Admission Details ")
print("2 : Show Admin_Details")
print("3 : Search ")
print("4 : Deletion")
print("5 : Update Admission Details")
print("6 : Return to MAIN MENU...")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :")) 1
if choice==1:
admission.Admin_details()
elif choice==2:
admission.Show_Admin_Details()
elif choice==3:
admission.Search_Admin_Details()
elif choice==4:
admission.Delete_Admin_Details()
elif choice==5:
admission.Edit_Admin_Details()
elif choice==6:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key return to MAIN - MENU..")
import main_menu
import student_data
def STU_MENU(): #student_data.py module
while True:
student_data.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT DATA M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Add Student Record ")
print("2 : Show Student Details")
print("3 : Search Student Record")
print("4 : Delete Student Record ")
print("5 : Edit Student Record ")
print("6 : Return")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :"))
if choice==1:
student_data.Add_Records()
elif choice==2:
student_data.Show_Stu_Details()
elif choice==3:
student_data.Search_Stu_Details()
elif choice==4:
student_data.Delete_Stu_Details()
elif choice==5:
student_data.Edit_Stu_Details()
elif choice==6:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
def FEE_MENU(): #fee_details.py module
while True:
fees_details.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT FEE M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Fee Deposit ")
print("2 : Fee Details")
print("3 : return to Main Menu..")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-3 :"))2
if choice==1:
fees_details.fees_Deposit()
elif choice==2:
fees_details.FDetails()
elif choice==3:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
import main_menu
import lib_details
def LIB_MENU(): #lib_details.py module
while True:
lib_details.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** Library M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Book Issue ")
print("2 : Book Return")
print("3 : return to Main Menu..")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-3 :"))
if choice==1:
lib_details.book_issue()
elif choice==2:
lib_details.book_return()
elif choice==3:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
import admission
import mysql.connector
def Admin_details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
adno=input("Enter Admission No ")
rollno=int(input("Enter Rollno :"))
sname=input("Enter Student Name :")
address=input("Enter Address :")
phone=input("Enter Phone No.")
class1=input("Enter Class")
Query=("Insert into admission values(%s,%d,%s,%s,%s,%s))
Record=(adno,rollno,sname,phone,class))
MyCur.execute(Query,Record)
MyCur.close()
MyCon.close()
print("Record has been Saved .. in Admission Data Table....")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
MyCon.close()
from mysql.connector import errorcode
from mysql.connector import(connection)
def Show_Admin_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
Query= (āSelect *from Admissionā)
MyCur.execute(Query)
for(adno,rollno,name,addres,class) in cursor:
print(āAdmission Codeā,adno)
print(āRoll Numberā,rollno)
print(āStudent Nameā,sname)
print(āAddressā,address)
print(āPhone Numberā,phone, āClassā,class)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#--------------------------------------------------------------------------------
def Search_Admin_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Admission
where temp_adno= ā%sā)
rec_srch=(temp_adno,)
MyCur.execute(Query,rec_srch)
for(adno,rollno,name,addres,class) in cursor:
print(āAdmission Codeā,adno)
print(āRoll Numberā,rollno)
print(āStudent Nameā,sname)
print(āAddressā,address)
print(āPhone Numberā,phone, āClassā,class)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#--------------------------------------------------------------------------------------
#admission.def delete_Admin_Details()
#--------------------------------------------------------------------------------------
def delete_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number
to be Delete :ā)
MyCur=mycon.cursor()
Query= (ā ā ā Delete from Admission
where adno= ā%sā)
rec_srch=(temp_adno,)
MyCur.execute(Query,rec_srch)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
print("Record has been deleted Now ")
#-------------------------------------------------------------------------------------------------
#admission.Edit_Admin_Details(): ADM_MENU() Choice=5
#-------------------------------------------------------------------------------------------------
def Edit_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number
to be Update / Edit :ā)
Query= (ā ā ā Select *from Admission
where temp_adno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_adno,)
print("Input New Data ")
sname=input("Enter Student Name :")
address=input("Enter Address :")
phone=input("Enter Phone No.")
class1=input("Enter Class")
Q=("Update admission set sname="%s",address="%s",
phone="%s",class1="%s", where temp_adno="%s")
D=(sname,address,phone,class1)
MyCur.execute(Q,D)
print("Record has been updated Now")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid
print("Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
""" print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** ABC School - M A I N M E N U * * ** ")
print("1 : Admission")
print("2 : Student Data")
print("3 : Fees Details")
print("4 : Library Details ")
print("5 : Exit")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice :")) 1
print("\n\t\t * * ** A D M I S S I O N M E N U * * ** ")
print("\t\t--------------------------------------------------")
print("1 : Admission Details ")
print("2 : Show Admin_Details")
print("3 : Search ")
print("4 : Deletion")
print("5 : Update Admission Details")
print("6 : Return to MAIN MENU...")
print("\t\t--------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :"))
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT DATA M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Add Student Record ")
print("2 : Show Student Details")
print("3 : Search Student Record")
print("4 : Delete Student Record ")
print("5 : Edit Student Record ")
print("6 : Return...")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :")) 1
#-----------------------------------------------------------------------------:-)
if choice==1:
student_data.Add_Records()
elif choice==2:
student_data.Show_Stu_Details()
elif choice==3:
student_data.Search_Stu_Details()
elif choice==4:
student_data.Delete_Stu_Details()
elif choice==5:
student_data.Edit_Stu_Details()
elif choice==6:
return
"""
#---------------------------------------------------------
# #1 Add Student Record | def Add_Records
#---------------------------------------------------------
import admission
import mysql.connector
import student_data
def Add_Records():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
rollno=int(input("Enter Rollno :"))
sname=input("Enter Student Name :")
add=input("Enter Address :")
Stream=input("Enter Stream:")
Query=("Insert into student_data
values(%s,%s,%s,%s)
Record=(rollno,sname,add,stream))
MyCur.execute(Query,Record)
MyCur.close()
MyCon.close()
print("Record has been Saved .. in Student Data Table....")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
MyCon.close()
#---------------------------------------------------------
# #2 Show Student Record | def Show_Stu_Details()
#---------------------------------------------------------
def Show_Stu_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
Query= (āSelect *from Student_Dataā)
MyCur.execute(Query)
for(rollno,sname,add,stream) in cursor:
print("Student Rollno ",rollno)
print("Student Name",name)
print("Address",add)
print("Stream",stream)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#-------------------------------------------------------------------------
# #3 Search Student Record | def Search_Stu_Details()
#---------------------------------------------------------------------
def Search_Stu_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Student_data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,add,stream) in cursor:
print("Student Rollno ",rollno)
print("Student Name",name)
print("Address",add)
print("Stream",stream)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#-------------------------------------------------------------------------
# #4 Delete Student Record | def Delete_Stu_Details()
#---------------------------------------------------------------------
def Delete_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number
to be Delete :ā)
MyCur=mycon.cursor()
Query= (ā ā ā Delete from Student_Data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
print("Record has been deleted Now ")
#-------------------------------------------------------------------
# #5 Edit Student Record | def Edit_Stu_Details()
#---------------------------------------------------------------------
def Edit_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number
to be Update / Edit :ā)
Query= (ā ā ā Select *from Student_Data
where temp_rollno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_rollno,)
print("Input New Data ")
name=input("Enter Student Name :")
add=input("Enter Address :")
stream=input("Enter Stream")
Q=("Update student_data set name="%s",add="%s",
stream="%s" where temp_rollno="%s")
D=(name,add,stream)
MyCur.execute(Q,D)
print("Record has been updated Now")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid
print("Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#------------------end of Student Data Menu ---------------------------------------
#-----------------------------------------------------------------------------------
# Learn
#
# print("\t\t-------------------------------------------------------------------------")
# print("\n\t\t * * ** STUDENT FEE M E N U * * ** ")
# print("\t\t-------------------------------------------------------------------------")
# print("1 : Fee Deposit ")
# print("2 : Fee Details")
# print("3 : return to Main Menu..")
#-----------------------------------------------------------------------------------
def Fee_Deposit():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number:ā)
Query= (ā ā ā Select *from Student_Data
where temp_rollno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_rollno,)
fees=int(input("Enter Deposit Fees"))
Q=("Update student_data set fees="%f"
where temp_rollno="%s")
D=(fees)
MyCur.execute(Q,D)
print(" ! Fees has been Deposited !")
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
#Fee Details
#----------------------------------------------------------------------------------------------
def Fee_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Student_data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1) in cursor:
print("Student Rollno",rollno)
print("Student Class ",class1)
print("Name & Fees" ,sname, Fees)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
# Next & Last MENU
#Library Details
#print("\t\t-------------------------------------------------------------------------")
#print("\n\t\t * * ** Library M E N U * * ** ")
#print("\t\t-------------------------------------------------------------------------")
#print("1 : Book Issue ")
#print("2 : Book Return")
#print("3 : return to Main Menu..")
#print("\t\t-------------------------------------------------------------------------")
#----------------------------------------------------------------------------------------------
def book_issue():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number :ā)
MyCur=mycon.cursor()
Query= (āSelect *from library
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1,bname,issuedate) in cursor:
print("Student Rollno",rollno)
print("Student Name ",name)
print("Book Name " ,bname)
print("Book Issue Date" ,issuedate)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
def book_return():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number :ā)
MyCur=mycon.cursor()
Query= (āSelect *from library
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1,bname,returndate) in cursor:
print("Student Rollno",rollno)
print("Student Name ",name)
print("Book Name " ,bname)
print("Book Return Date" ,returndate)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
# -- End of Project --------------------------#
download at
www.ramkohli.blogspot.in
#-------------------------------------------------------#
# Welcome to Study Tech Academy
#Python Project for Class 12 CBSE Board New Syllabus
#as per CBSE Guideline
# -------------------------------------------------------------------------
# * ** * Welcome to School Management System * * * *
# ------------------------------------------------------------------------
import main_menu
import admission
import student_data
import fee_details
import lib_details
while True:
# main_menu.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *")
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** ABC School - M A I N M E N U * * ** ")
print("1 : Admission")
print("2 : Student Data")
print("3 : Fees Details")
print("4 : Library Details ")
print("5 : Exit")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice :"))
if choice==1:
admission.ADM_MENU()
elif choice==2:
student_data.STU_MENU()
elif choice==3:
fee_details.FEE_MENU()
elif choice==4:
lib_details.LIB_MENU()
elif choice==5:
break
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to continue...")
import main_menu
import admission
def ADM_MENU():
while True:
admission.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** A D M I S S I O N M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Admission Details ")
print("2 : Show Admin_Details")
print("3 : Search ")
print("4 : Deletion")
print("5 : Update Admission Details")
print("6 : Return to MAIN MENU...")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :")) 1
if choice==1:
admission.Admin_details()
elif choice==2:
admission.Show_Admin_Details()
elif choice==3:
admission.Search_Admin_Details()
elif choice==4:
admission.Delete_Admin_Details()
elif choice==5:
admission.Edit_Admin_Details()
elif choice==6:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key return to MAIN - MENU..")
import main_menu
import student_data
def STU_MENU(): #student_data.py module
while True:
student_data.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT DATA M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Add Student Record ")
print("2 : Show Student Details")
print("3 : Search Student Record")
print("4 : Delete Student Record ")
print("5 : Edit Student Record ")
print("6 : Return")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :"))
if choice==1:
student_data.Add_Records()
elif choice==2:
student_data.Show_Stu_Details()
elif choice==3:
student_data.Search_Stu_Details()
elif choice==4:
student_data.Delete_Stu_Details()
elif choice==5:
student_data.Edit_Stu_Details()
elif choice==6:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
def FEE_MENU(): #fee_details.py module
while True:
fees_details.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT FEE M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Fee Deposit ")
print("2 : Fee Details")
print("3 : return to Main Menu..")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-3 :"))2
if choice==1:
fees_details.fees_Deposit()
elif choice==2:
fees_details.FDetails()
elif choice==3:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
import main_menu
import lib_details
def LIB_MENU(): #lib_details.py module
while True:
lib_details.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** Library M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Book Issue ")
print("2 : Book Return")
print("3 : return to Main Menu..")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-3 :"))
if choice==1:
lib_details.book_issue()
elif choice==2:
lib_details.book_return()
elif choice==3:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
import admission
import mysql.connector
def Admin_details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
adno=input("Enter Admission No ")
rollno=int(input("Enter Rollno :"))
sname=input("Enter Student Name :")
address=input("Enter Address :")
phone=input("Enter Phone No.")
class1=input("Enter Class")
Query=("Insert into admission values(%s,%d,%s,%s,%s,%s))
Record=(adno,rollno,sname,phone,class))
MyCur.execute(Query,Record)
MyCur.close()
MyCon.close()
print("Record has been Saved .. in Admission Data Table....")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
MyCon.close()
from mysql.connector import errorcode
from mysql.connector import(connection)
def Show_Admin_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
Query= (āSelect *from Admissionā)
MyCur.execute(Query)
for(adno,rollno,name,addres,class) in cursor:
print(āAdmission Codeā,adno)
print(āRoll Numberā,rollno)
print(āStudent Nameā,sname)
print(āAddressā,address)
print(āPhone Numberā,phone, āClassā,class)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#--------------------------------------------------------------------------------
def Search_Admin_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Admission
where temp_adno= ā%sā)
rec_srch=(temp_adno,)
MyCur.execute(Query,rec_srch)
for(adno,rollno,name,addres,class) in cursor:
print(āAdmission Codeā,adno)
print(āRoll Numberā,rollno)
print(āStudent Nameā,sname)
print(āAddressā,address)
print(āPhone Numberā,phone, āClassā,class)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#--------------------------------------------------------------------------------------
#admission.def delete_Admin_Details()
#--------------------------------------------------------------------------------------
def delete_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number
to be Delete :ā)
MyCur=mycon.cursor()
Query= (ā ā ā Delete from Admission
where adno= ā%sā)
rec_srch=(temp_adno,)
MyCur.execute(Query,rec_srch)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
print("Record has been deleted Now ")
#-------------------------------------------------------------------------------------------------
#admission.Edit_Admin_Details(): ADM_MENU() Choice=5
#-------------------------------------------------------------------------------------------------
def Edit_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number
to be Update / Edit :ā)
Query= (ā ā ā Select *from Admission
where temp_adno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_adno,)
print("Input New Data ")
sname=input("Enter Student Name :")
address=input("Enter Address :")
phone=input("Enter Phone No.")
class1=input("Enter Class")
Q=("Update admission set sname="%s",address="%s",
phone="%s",class1="%s", where temp_adno="%s")
D=(sname,address,phone,class1)
MyCur.execute(Q,D)
print("Record has been updated Now")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid
print("Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
""" print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** ABC School - M A I N M E N U * * ** ")
print("1 : Admission")
print("2 : Student Data")
print("3 : Fees Details")
print("4 : Library Details ")
print("5 : Exit")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice :")) 1
print("\n\t\t * * ** A D M I S S I O N M E N U * * ** ")
print("\t\t--------------------------------------------------")
print("1 : Admission Details ")
print("2 : Show Admin_Details")
print("3 : Search ")
print("4 : Deletion")
print("5 : Update Admission Details")
print("6 : Return to MAIN MENU...")
print("\t\t--------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :"))
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT DATA M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Add Student Record ")
print("2 : Show Student Details")
print("3 : Search Student Record")
print("4 : Delete Student Record ")
print("5 : Edit Student Record ")
print("6 : Return...")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :")) 1
#-----------------------------------------------------------------------------:-)
if choice==1:
student_data.Add_Records()
elif choice==2:
student_data.Show_Stu_Details()
elif choice==3:
student_data.Search_Stu_Details()
elif choice==4:
student_data.Delete_Stu_Details()
elif choice==5:
student_data.Edit_Stu_Details()
elif choice==6:
return
"""
#---------------------------------------------------------
# #1 Add Student Record | def Add_Records
#---------------------------------------------------------
import admission
import mysql.connector
import student_data
def Add_Records():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
rollno=int(input("Enter Rollno :"))
sname=input("Enter Student Name :")
add=input("Enter Address :")
Stream=input("Enter Stream:")
Query=("Insert into student_data
values(%s,%s,%s,%s)
Record=(rollno,sname,add,stream))
MyCur.execute(Query,Record)
MyCur.close()
MyCon.close()
print("Record has been Saved .. in Student Data Table....")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
MyCon.close()
#---------------------------------------------------------
# #2 Show Student Record | def Show_Stu_Details()
#---------------------------------------------------------
def Show_Stu_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
Query= (āSelect *from Student_Dataā)
MyCur.execute(Query)
for(rollno,sname,add,stream) in cursor:
print("Student Rollno ",rollno)
print("Student Name",name)
print("Address",add)
print("Stream",stream)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#-------------------------------------------------------------------------
# #3 Search Student Record | def Search_Stu_Details()
#---------------------------------------------------------------------
def Search_Stu_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Student_data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,add,stream) in cursor:
print("Student Rollno ",rollno)
print("Student Name",name)
print("Address",add)
print("Stream",stream)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#-------------------------------------------------------------------------
# #4 Delete Student Record | def Delete_Stu_Details()
#---------------------------------------------------------------------
def Delete_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number
to be Delete :ā)
MyCur=mycon.cursor()
Query= (ā ā ā Delete from Student_Data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
print("Record has been deleted Now ")
#-------------------------------------------------------------------
# #5 Edit Student Record | def Edit_Stu_Details()
#---------------------------------------------------------------------
def Edit_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number
to be Update / Edit :ā)
Query= (ā ā ā Select *from Student_Data
where temp_rollno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_rollno,)
print("Input New Data ")
name=input("Enter Student Name :")
add=input("Enter Address :")
stream=input("Enter Stream")
Q=("Update student_data set name="%s",add="%s",
stream="%s" where temp_rollno="%s")
D=(name,add,stream)
MyCur.execute(Q,D)
print("Record has been updated Now")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid
print("Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#------------------end of Student Data Menu ---------------------------------------
#-----------------------------------------------------------------------------------
# Learn
#
# print("\t\t-------------------------------------------------------------------------")
# print("\n\t\t * * ** STUDENT FEE M E N U * * ** ")
# print("\t\t-------------------------------------------------------------------------")
# print("1 : Fee Deposit ")
# print("2 : Fee Details")
# print("3 : return to Main Menu..")
#-----------------------------------------------------------------------------------
def Fee_Deposit():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number:ā)
Query= (ā ā ā Select *from Student_Data
where temp_rollno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_rollno,)
fees=int(input("Enter Deposit Fees"))
Q=("Update student_data set fees="%f"
where temp_rollno="%s")
D=(fees)
MyCur.execute(Q,D)
print(" ! Fees has been Deposited !")
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
#Fee Details
#----------------------------------------------------------------------------------------------
def Fee_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Student_data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1) in cursor:
print("Student Rollno",rollno)
print("Student Class ",class1)
print("Name & Fees" ,sname, Fees)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
# Next & Last MENU
#Library Details
#print("\t\t-------------------------------------------------------------------------")
#print("\n\t\t * * ** Library M E N U * * ** ")
#print("\t\t-------------------------------------------------------------------------")
#print("1 : Book Issue ")
#print("2 : Book Return")
#print("3 : return to Main Menu..")
#print("\t\t-------------------------------------------------------------------------")
#----------------------------------------------------------------------------------------------
def book_issue():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number :ā)
MyCur=mycon.cursor()
Query= (āSelect *from library
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1,bname,issuedate) in cursor:
print("Student Rollno",rollno)
print("Student Name ",name)
print("Book Name " ,bname)
print("Book Issue Date" ,issuedate)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
def book_return():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number :ā)
MyCur=mycon.cursor()
Query= (āSelect *from library
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1,bname,returndate) in cursor:
print("Student Rollno",rollno)
print("Student Name ",name)
print("Book Name " ,bname)
print("Book Return Date" ,returndate)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
# -- End of Project --------------------------#
download at
www.ramkohli.blogspot.in
#-------------------------------------------------------#
# * ** * Welcome to School Management System * * * *
# ------------------------------------------------------------------------
import main_menu
import admission
import student_data
import fee_details
import lib_details
while True:
# main_menu.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *")
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** ABC School - M A I N M E N U * * ** ")
print("1 : Admission")
print("2 : Student Data")
print("3 : Fees Details")
print("4 : Library Details ")
print("5 : Exit")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice :"))
if choice==1:
admission.ADM_MENU()
elif choice==2:
student_data.STU_MENU()
elif choice==3:
fee_details.FEE_MENU()
elif choice==4:
lib_details.LIB_MENU()
elif choice==5:
break
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to continue...")
import main_menu
import admission
def ADM_MENU():
while True:
admission.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** A D M I S S I O N M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Admission Details ")
print("2 : Show Admin_Details")
print("3 : Search ")
print("4 : Deletion")
print("5 : Update Admission Details")
print("6 : Return to MAIN MENU...")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :")) 1
if choice==1:
admission.Admin_details()
elif choice==2:
admission.Show_Admin_Details()
elif choice==3:
admission.Search_Admin_Details()
elif choice==4:
admission.Delete_Admin_Details()
elif choice==5:
admission.Edit_Admin_Details()
elif choice==6:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key return to MAIN - MENU..")
import main_menu
import student_data
def STU_MENU(): #student_data.py module
while True:
student_data.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT DATA M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Add Student Record ")
print("2 : Show Student Details")
print("3 : Search Student Record")
print("4 : Delete Student Record ")
print("5 : Edit Student Record ")
print("6 : Return")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :"))
if choice==1:
student_data.Add_Records()
elif choice==2:
student_data.Show_Stu_Details()
elif choice==3:
student_data.Search_Stu_Details()
elif choice==4:
student_data.Delete_Stu_Details()
elif choice==5:
student_data.Edit_Stu_Details()
elif choice==6:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
def FEE_MENU(): #fee_details.py module
while True:
fees_details.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT FEE M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Fee Deposit ")
print("2 : Fee Details")
print("3 : return to Main Menu..")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-3 :"))2
if choice==1:
fees_details.fees_Deposit()
elif choice==2:
fees_details.FDetails()
elif choice==3:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
import main_menu
import lib_details
def LIB_MENU(): #lib_details.py module
while True:
lib_details.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** Library M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Book Issue ")
print("2 : Book Return")
print("3 : return to Main Menu..")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-3 :"))
if choice==1:
lib_details.book_issue()
elif choice==2:
lib_details.book_return()
elif choice==3:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
import admission
import mysql.connector
def Admin_details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
adno=input("Enter Admission No ")
rollno=int(input("Enter Rollno :"))
sname=input("Enter Student Name :")
address=input("Enter Address :")
phone=input("Enter Phone No.")
class1=input("Enter Class")
Query=("Insert into admission values(%s,%d,%s,%s,%s,%s))
Record=(adno,rollno,sname,phone,class))
MyCur.execute(Query,Record)
MyCur.close()
MyCon.close()
print("Record has been Saved .. in Admission Data Table....")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
MyCon.close()
from mysql.connector import errorcode
from mysql.connector import(connection)
def Show_Admin_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
Query= (āSelect *from Admissionā)
MyCur.execute(Query)
for(adno,rollno,name,addres,class) in cursor:
print(āAdmission Codeā,adno)
print(āRoll Numberā,rollno)
print(āStudent Nameā,sname)
print(āAddressā,address)
print(āPhone Numberā,phone, āClassā,class)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#--------------------------------------------------------------------------------
def Search_Admin_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Admission
where temp_adno= ā%sā)
rec_srch=(temp_adno,)
MyCur.execute(Query,rec_srch)
for(adno,rollno,name,addres,class) in cursor:
print(āAdmission Codeā,adno)
print(āRoll Numberā,rollno)
print(āStudent Nameā,sname)
print(āAddressā,address)
print(āPhone Numberā,phone, āClassā,class)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#--------------------------------------------------------------------------------------
#admission.def delete_Admin_Details()
#--------------------------------------------------------------------------------------
def delete_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number
to be Delete :ā)
MyCur=mycon.cursor()
Query= (ā ā ā Delete from Admission
where adno= ā%sā)
rec_srch=(temp_adno,)
MyCur.execute(Query,rec_srch)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
print("Record has been deleted Now ")
#-------------------------------------------------------------------------------------------------
#admission.Edit_Admin_Details(): ADM_MENU() Choice=5
#-------------------------------------------------------------------------------------------------
def Edit_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number
to be Update / Edit :ā)
Query= (ā ā ā Select *from Admission
where temp_adno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_adno,)
print("Input New Data ")
sname=input("Enter Student Name :")
address=input("Enter Address :")
phone=input("Enter Phone No.")
class1=input("Enter Class")
Q=("Update admission set sname="%s",address="%s",
phone="%s",class1="%s", where temp_adno="%s")
D=(sname,address,phone,class1)
MyCur.execute(Q,D)
print("Record has been updated Now")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid
print("Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
""" print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** ABC School - M A I N M E N U * * ** ")
print("1 : Admission")
print("2 : Student Data")
print("3 : Fees Details")
print("4 : Library Details ")
print("5 : Exit")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice :")) 1
print("\n\t\t * * ** A D M I S S I O N M E N U * * ** ")
print("\t\t--------------------------------------------------")
print("1 : Admission Details ")
print("2 : Show Admin_Details")
print("3 : Search ")
print("4 : Deletion")
print("5 : Update Admission Details")
print("6 : Return to MAIN MENU...")
print("\t\t--------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :"))
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT DATA M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Add Student Record ")
print("2 : Show Student Details")
print("3 : Search Student Record")
print("4 : Delete Student Record ")
print("5 : Edit Student Record ")
print("6 : Return...")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :")) 1
#-----------------------------------------------------------------------------:-)
if choice==1:
student_data.Add_Records()
elif choice==2:
student_data.Show_Stu_Details()
elif choice==3:
student_data.Search_Stu_Details()
elif choice==4:
student_data.Delete_Stu_Details()
elif choice==5:
student_data.Edit_Stu_Details()
elif choice==6:
return
"""
#---------------------------------------------------------
# #1 Add Student Record | def Add_Records
#---------------------------------------------------------
import admission
import mysql.connector
import student_data
def Add_Records():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
rollno=int(input("Enter Rollno :"))
sname=input("Enter Student Name :")
add=input("Enter Address :")
Stream=input("Enter Stream:")
Query=("Insert into student_data
values(%s,%s,%s,%s)
Record=(rollno,sname,add,stream))
MyCur.execute(Query,Record)
MyCur.close()
MyCon.close()
print("Record has been Saved .. in Student Data Table....")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
MyCon.close()
#---------------------------------------------------------
# #2 Show Student Record | def Show_Stu_Details()
#---------------------------------------------------------
def Show_Stu_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
Query= (āSelect *from Student_Dataā)
MyCur.execute(Query)
for(rollno,sname,add,stream) in cursor:
print("Student Rollno ",rollno)
print("Student Name",name)
print("Address",add)
print("Stream",stream)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#-------------------------------------------------------------------------
# #3 Search Student Record | def Search_Stu_Details()
#---------------------------------------------------------------------
def Search_Stu_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Student_data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,add,stream) in cursor:
print("Student Rollno ",rollno)
print("Student Name",name)
print("Address",add)
print("Stream",stream)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#-------------------------------------------------------------------------
# #4 Delete Student Record | def Delete_Stu_Details()
#---------------------------------------------------------------------
def Delete_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number
to be Delete :ā)
MyCur=mycon.cursor()
Query= (ā ā ā Delete from Student_Data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
print("Record has been deleted Now ")
#-------------------------------------------------------------------
# #5 Edit Student Record | def Edit_Stu_Details()
#---------------------------------------------------------------------
def Edit_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number
to be Update / Edit :ā)
Query= (ā ā ā Select *from Student_Data
where temp_rollno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_rollno,)
print("Input New Data ")
name=input("Enter Student Name :")
add=input("Enter Address :")
stream=input("Enter Stream")
Q=("Update student_data set name="%s",add="%s",
stream="%s" where temp_rollno="%s")
D=(name,add,stream)
MyCur.execute(Q,D)
print("Record has been updated Now")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid
print("Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#------------------end of Student Data Menu ---------------------------------------
#-----------------------------------------------------------------------------------
# Learn
#
# print("\t\t-------------------------------------------------------------------------")
# print("\n\t\t * * ** STUDENT FEE M E N U * * ** ")
# print("\t\t-------------------------------------------------------------------------")
# print("1 : Fee Deposit ")
# print("2 : Fee Details")
# print("3 : return to Main Menu..")
#-----------------------------------------------------------------------------------
def Fee_Deposit():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number:ā)
Query= (ā ā ā Select *from Student_Data
where temp_rollno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_rollno,)
fees=int(input("Enter Deposit Fees"))
Q=("Update student_data set fees="%f"
where temp_rollno="%s")
D=(fees)
MyCur.execute(Q,D)
print(" ! Fees has been Deposited !")
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
#Fee Details
#----------------------------------------------------------------------------------------------
def Fee_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Student_data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1) in cursor:
print("Student Rollno",rollno)
print("Student Class ",class1)
print("Name & Fees" ,sname, Fees)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
# Next & Last MENU
#Library Details
#print("\t\t-------------------------------------------------------------------------")
#print("\n\t\t * * ** Library M E N U * * ** ")
#print("\t\t-------------------------------------------------------------------------")
#print("1 : Book Issue ")
#print("2 : Book Return")
#print("3 : return to Main Menu..")
#print("\t\t-------------------------------------------------------------------------")
#----------------------------------------------------------------------------------------------
def book_issue():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number :ā)
MyCur=mycon.cursor()
Query= (āSelect *from library
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1,bname,issuedate) in cursor:
print("Student Rollno",rollno)
print("Student Name ",name)
print("Book Name " ,bname)
print("Book Issue Date" ,issuedate)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
def book_return():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number :ā)
MyCur=mycon.cursor()
Query= (āSelect *from library
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1,bname,returndate) in cursor:
print("Student Rollno",rollno)
print("Student Name ",name)
print("Book Name " ,bname)
print("Book Return Date" ,returndate)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
# -- End of Project --------------------------#
download at
www.ramkohli.blogspot.in
#-------------------------------------------------------#
# Welcome to Study Tech Academy
#Python Project for Class 12 CBSE Board New Syllabus
#as per CBSE Guideline
# -------------------------------------------------------------------------
# * ** * Welcome to School Management System * * * *
# ------------------------------------------------------------------------
import main_menu
import admission
import student_data
import fee_details
import lib_details
while True:
# main_menu.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *")
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** ABC School - M A I N M E N U * * ** ")
print("1 : Admission")
print("2 : Student Data")
print("3 : Fees Details")
print("4 : Library Details ")
print("5 : Exit")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice :"))
if choice==1:
admission.ADM_MENU()
elif choice==2:
student_data.STU_MENU()
elif choice==3:
fee_details.FEE_MENU()
elif choice==4:
lib_details.LIB_MENU()
elif choice==5:
break
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to continue...")
import main_menu
import admission
def ADM_MENU():
while True:
admission.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** A D M I S S I O N M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Admission Details ")
print("2 : Show Admin_Details")
print("3 : Search ")
print("4 : Deletion")
print("5 : Update Admission Details")
print("6 : Return to MAIN MENU...")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :")) 1
if choice==1:
admission.Admin_details()
elif choice==2:
admission.Show_Admin_Details()
elif choice==3:
admission.Search_Admin_Details()
elif choice==4:
admission.Delete_Admin_Details()
elif choice==5:
admission.Edit_Admin_Details()
elif choice==6:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key return to MAIN - MENU..")
import main_menu
import student_data
def STU_MENU(): #student_data.py module
while True:
student_data.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT DATA M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Add Student Record ")
print("2 : Show Student Details")
print("3 : Search Student Record")
print("4 : Delete Student Record ")
print("5 : Edit Student Record ")
print("6 : Return")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :"))
if choice==1:
student_data.Add_Records()
elif choice==2:
student_data.Show_Stu_Details()
elif choice==3:
student_data.Search_Stu_Details()
elif choice==4:
student_data.Delete_Stu_Details()
elif choice==5:
student_data.Edit_Stu_Details()
elif choice==6:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
def FEE_MENU(): #fee_details.py module
while True:
fees_details.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT FEE M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Fee Deposit ")
print("2 : Fee Details")
print("3 : return to Main Menu..")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-3 :"))2
if choice==1:
fees_details.fees_Deposit()
elif choice==2:
fees_details.FDetails()
elif choice==3:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
import main_menu
import lib_details
def LIB_MENU(): #lib_details.py module
while True:
lib_details.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** Library M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Book Issue ")
print("2 : Book Return")
print("3 : return to Main Menu..")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-3 :"))
if choice==1:
lib_details.book_issue()
elif choice==2:
lib_details.book_return()
elif choice==3:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
import admission
import mysql.connector
def Admin_details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
adno=input("Enter Admission No ")
rollno=int(input("Enter Rollno :"))
sname=input("Enter Student Name :")
address=input("Enter Address :")
phone=input("Enter Phone No.")
class1=input("Enter Class")
Query=("Insert into admission values(%s,%d,%s,%s,%s,%s))
Record=(adno,rollno,sname,phone,class))
MyCur.execute(Query,Record)
MyCur.close()
MyCon.close()
print("Record has been Saved .. in Admission Data Table....")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
MyCon.close()
from mysql.connector import errorcode
from mysql.connector import(connection)
def Show_Admin_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
Query= (āSelect *from Admissionā)
MyCur.execute(Query)
for(adno,rollno,name,addres,class) in cursor:
print(āAdmission Codeā,adno)
print(āRoll Numberā,rollno)
print(āStudent Nameā,sname)
print(āAddressā,address)
print(āPhone Numberā,phone, āClassā,class)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#--------------------------------------------------------------------------------
def Search_Admin_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Admission
where temp_adno= ā%sā)
rec_srch=(temp_adno,)
MyCur.execute(Query,rec_srch)
for(adno,rollno,name,addres,class) in cursor:
print(āAdmission Codeā,adno)
print(āRoll Numberā,rollno)
print(āStudent Nameā,sname)
print(āAddressā,address)
print(āPhone Numberā,phone, āClassā,class)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#--------------------------------------------------------------------------------------
#admission.def delete_Admin_Details()
#--------------------------------------------------------------------------------------
def delete_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number
to be Delete :ā)
MyCur=mycon.cursor()
Query= (ā ā ā Delete from Admission
where adno= ā%sā)
rec_srch=(temp_adno,)
MyCur.execute(Query,rec_srch)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
print("Record has been deleted Now ")
#-------------------------------------------------------------------------------------------------
#admission.Edit_Admin_Details(): ADM_MENU() Choice=5
#-------------------------------------------------------------------------------------------------
def Edit_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number
to be Update / Edit :ā)
Query= (ā ā ā Select *from Admission
where temp_adno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_adno,)
print("Input New Data ")
sname=input("Enter Student Name :")
address=input("Enter Address :")
phone=input("Enter Phone No.")
class1=input("Enter Class")
Q=("Update admission set sname="%s",address="%s",
phone="%s",class1="%s", where temp_adno="%s")
D=(sname,address,phone,class1)
MyCur.execute(Q,D)
print("Record has been updated Now")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid
print("Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
""" print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** ABC School - M A I N M E N U * * ** ")
print("1 : Admission")
print("2 : Student Data")
print("3 : Fees Details")
print("4 : Library Details ")
print("5 : Exit")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice :")) 1
print("\n\t\t * * ** A D M I S S I O N M E N U * * ** ")
print("\t\t--------------------------------------------------")
print("1 : Admission Details ")
print("2 : Show Admin_Details")
print("3 : Search ")
print("4 : Deletion")
print("5 : Update Admission Details")
print("6 : Return to MAIN MENU...")
print("\t\t--------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :"))
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT DATA M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Add Student Record ")
print("2 : Show Student Details")
print("3 : Search Student Record")
print("4 : Delete Student Record ")
print("5 : Edit Student Record ")
print("6 : Return...")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :")) 1
#-----------------------------------------------------------------------------:-)
if choice==1:
student_data.Add_Records()
elif choice==2:
student_data.Show_Stu_Details()
elif choice==3:
student_data.Search_Stu_Details()
elif choice==4:
student_data.Delete_Stu_Details()
elif choice==5:
student_data.Edit_Stu_Details()
elif choice==6:
return
"""
#---------------------------------------------------------
# #1 Add Student Record | def Add_Records
#---------------------------------------------------------
import admission
import mysql.connector
import student_data
def Add_Records():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
rollno=int(input("Enter Rollno :"))
sname=input("Enter Student Name :")
add=input("Enter Address :")
Stream=input("Enter Stream:")
Query=("Insert into student_data
values(%s,%s,%s,%s)
Record=(rollno,sname,add,stream))
MyCur.execute(Query,Record)
MyCur.close()
MyCon.close()
print("Record has been Saved .. in Student Data Table....")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
MyCon.close()
#---------------------------------------------------------
# #2 Show Student Record | def Show_Stu_Details()
#---------------------------------------------------------
def Show_Stu_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
Query= (āSelect *from Student_Dataā)
MyCur.execute(Query)
for(rollno,sname,add,stream) in cursor:
print("Student Rollno ",rollno)
print("Student Name",name)
print("Address",add)
print("Stream",stream)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#-------------------------------------------------------------------------
# #3 Search Student Record | def Search_Stu_Details()
#---------------------------------------------------------------------
def Search_Stu_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Student_data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,add,stream) in cursor:
print("Student Rollno ",rollno)
print("Student Name",name)
print("Address",add)
print("Stream",stream)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#-------------------------------------------------------------------------
# #4 Delete Student Record | def Delete_Stu_Details()
#---------------------------------------------------------------------
def Delete_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number
to be Delete :ā)
MyCur=mycon.cursor()
Query= (ā ā ā Delete from Student_Data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
print("Record has been deleted Now ")
#-------------------------------------------------------------------
# #5 Edit Student Record | def Edit_Stu_Details()
#---------------------------------------------------------------------
def Edit_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number
to be Update / Edit :ā)
Query= (ā ā ā Select *from Student_Data
where temp_rollno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_rollno,)
print("Input New Data ")
name=input("Enter Student Name :")
add=input("Enter Address :")
stream=input("Enter Stream")
Q=("Update student_data set name="%s",add="%s",
stream="%s" where temp_rollno="%s")
D=(name,add,stream)
MyCur.execute(Q,D)
print("Record has been updated Now")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid
print("Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#------------------end of Student Data Menu ---------------------------------------
#-----------------------------------------------------------------------------------
# Learn
#
# print("\t\t-------------------------------------------------------------------------")
# print("\n\t\t * * ** STUDENT FEE M E N U * * ** ")
# print("\t\t-------------------------------------------------------------------------")
# print("1 : Fee Deposit ")
# print("2 : Fee Details")
# print("3 : return to Main Menu..")
#-----------------------------------------------------------------------------------
def Fee_Deposit():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number:ā)
Query= (ā ā ā Select *from Student_Data
where temp_rollno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_rollno,)
fees=int(input("Enter Deposit Fees"))
Q=("Update student_data set fees="%f"
where temp_rollno="%s")
D=(fees)
MyCur.execute(Q,D)
print(" ! Fees has been Deposited !")
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
#Fee Details
#----------------------------------------------------------------------------------------------
def Fee_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Student_data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1) in cursor:
print("Student Rollno",rollno)
print("Student Class ",class1)
print("Name & Fees" ,sname, Fees)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
# Next & Last MENU
#Library Details
#print("\t\t-------------------------------------------------------------------------")
#print("\n\t\t * * ** Library M E N U * * ** ")
#print("\t\t-------------------------------------------------------------------------")
#print("1 : Book Issue ")
#print("2 : Book Return")
#print("3 : return to Main Menu..")
#print("\t\t-------------------------------------------------------------------------")
#----------------------------------------------------------------------------------------------
def book_issue():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number :ā)
MyCur=mycon.cursor()
Query= (āSelect *from library
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1,bname,issuedate) in cursor:
print("Student Rollno",rollno)
print("Student Name ",name)
print("Book Name " ,bname)
print("Book Issue Date" ,issuedate)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
def book_return():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number :ā)
MyCur=mycon.cursor()
Query= (āSelect *from library
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1,bname,returndate) in cursor:
print("Student Rollno",rollno)
print("Student Name ",name)
print("Book Name " ,bname)
print("Book Return Date" ,returndate)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
# -- End of Project --------------------------#
download at
www.ramkohli.blogspot.in
#-------------------------------------------------------#
# Welcome to Study Tech Academy
#Python Project for Class 12 CBSE Board New Syllabus
#as per CBSE Guideline
# -------------------------------------------------------------------------
# * ** * Welcome to School Management System * * * *
# ------------------------------------------------------------------------
import main_menu
import admission
import student_data
import fee_details
import lib_details
while True:
# main_menu.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *")
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** ABC School - M A I N M E N U * * ** ")
print("1 : Admission")
print("2 : Student Data")
print("3 : Fees Details")
print("4 : Library Details ")
print("5 : Exit")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice :"))
if choice==1:
admission.ADM_MENU()
elif choice==2:
student_data.STU_MENU()
elif choice==3:
fee_details.FEE_MENU()
elif choice==4:
lib_details.LIB_MENU()
elif choice==5:
break
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to continue...")
import main_menu
import admission
def ADM_MENU():
while True:
admission.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** A D M I S S I O N M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Admission Details ")
print("2 : Show Admin_Details")
print("3 : Search ")
print("4 : Deletion")
print("5 : Update Admission Details")
print("6 : Return to MAIN MENU...")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :")) 1
if choice==1:
admission.Admin_details()
elif choice==2:
admission.Show_Admin_Details()
elif choice==3:
admission.Search_Admin_Details()
elif choice==4:
admission.Delete_Admin_Details()
elif choice==5:
admission.Edit_Admin_Details()
elif choice==6:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key return to MAIN - MENU..")
import main_menu
import student_data
def STU_MENU(): #student_data.py module
while True:
student_data.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT DATA M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Add Student Record ")
print("2 : Show Student Details")
print("3 : Search Student Record")
print("4 : Delete Student Record ")
print("5 : Edit Student Record ")
print("6 : Return")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :"))
if choice==1:
student_data.Add_Records()
elif choice==2:
student_data.Show_Stu_Details()
elif choice==3:
student_data.Search_Stu_Details()
elif choice==4:
student_data.Delete_Stu_Details()
elif choice==5:
student_data.Edit_Stu_Details()
elif choice==6:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
def FEE_MENU(): #fee_details.py module
while True:
fees_details.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT FEE M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Fee Deposit ")
print("2 : Fee Details")
print("3 : return to Main Menu..")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-3 :"))2
if choice==1:
fees_details.fees_Deposit()
elif choice==2:
fees_details.FDetails()
elif choice==3:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
import main_menu
import lib_details
def LIB_MENU(): #lib_details.py module
while True:
lib_details.clrscreen()
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** Library M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Book Issue ")
print("2 : Book Return")
print("3 : return to Main Menu..")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-3 :"))
if choice==1:
lib_details.book_issue()
elif choice==2:
lib_details.book_return()
elif choice==3:
return
else:
print("Error : Invalid Choice try again....")
conti=input("Press any key to Back to MAIN - MENU..")
import admission
import mysql.connector
def Admin_details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
adno=input("Enter Admission No ")
rollno=int(input("Enter Rollno :"))
sname=input("Enter Student Name :")
address=input("Enter Address :")
phone=input("Enter Phone No.")
class1=input("Enter Class")
Query=("Insert into admission values(%s,%d,%s,%s,%s,%s))
Record=(adno,rollno,sname,phone,class))
MyCur.execute(Query,Record)
MyCur.close()
MyCon.close()
print("Record has been Saved .. in Admission Data Table....")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
MyCon.close()
from mysql.connector import errorcode
from mysql.connector import(connection)
def Show_Admin_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
Query= (āSelect *from Admissionā)
MyCur.execute(Query)
for(adno,rollno,name,addres,class) in cursor:
print(āAdmission Codeā,adno)
print(āRoll Numberā,rollno)
print(āStudent Nameā,sname)
print(āAddressā,address)
print(āPhone Numberā,phone, āClassā,class)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#--------------------------------------------------------------------------------
def Search_Admin_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Admission
where temp_adno= ā%sā)
rec_srch=(temp_adno,)
MyCur.execute(Query,rec_srch)
for(adno,rollno,name,addres,class) in cursor:
print(āAdmission Codeā,adno)
print(āRoll Numberā,rollno)
print(āStudent Nameā,sname)
print(āAddressā,address)
print(āPhone Numberā,phone, āClassā,class)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#--------------------------------------------------------------------------------------
#admission.def delete_Admin_Details()
#--------------------------------------------------------------------------------------
def delete_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number
to be Delete :ā)
MyCur=mycon.cursor()
Query= (ā ā ā Delete from Admission
where adno= ā%sā)
rec_srch=(temp_adno,)
MyCur.execute(Query,rec_srch)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
print("Record has been deleted Now ")
#-------------------------------------------------------------------------------------------------
#admission.Edit_Admin_Details(): ADM_MENU() Choice=5
#-------------------------------------------------------------------------------------------------
def Edit_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_adno=input(āEnter Admission Number
to be Update / Edit :ā)
Query= (ā ā ā Select *from Admission
where temp_adno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_adno,)
print("Input New Data ")
sname=input("Enter Student Name :")
address=input("Enter Address :")
phone=input("Enter Phone No.")
class1=input("Enter Class")
Q=("Update admission set sname="%s",address="%s",
phone="%s",class1="%s", where temp_adno="%s")
D=(sname,address,phone,class1)
MyCur.execute(Q,D)
print("Record has been updated Now")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid
print("Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
""" print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** ABC School - M A I N M E N U * * ** ")
print("1 : Admission")
print("2 : Student Data")
print("3 : Fees Details")
print("4 : Library Details ")
print("5 : Exit")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice :")) 1
print("\n\t\t * * ** A D M I S S I O N M E N U * * ** ")
print("\t\t--------------------------------------------------")
print("1 : Admission Details ")
print("2 : Show Admin_Details")
print("3 : Search ")
print("4 : Deletion")
print("5 : Update Admission Details")
print("6 : Return to MAIN MENU...")
print("\t\t--------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :"))
print("\t\t-------------------------------------------------------------------------")
print("\t\t * ** * Welcome to School Management System * * * *)
print("\t\t-------------------------------------------------------------------------")
print("\n\t\t * * ** STUDENT DATA M E N U * * ** ")
print("\t\t-------------------------------------------------------------------------")
print("1 : Add Student Record ")
print("2 : Show Student Details")
print("3 : Search Student Record")
print("4 : Delete Student Record ")
print("5 : Edit Student Record ")
print("6 : Return...")
print("\t\t-------------------------------------------------------------------------")
choice=int(input("Enter Your Choice 1-6 :")) 1
#-----------------------------------------------------------------------------:-)
if choice==1:
student_data.Add_Records()
elif choice==2:
student_data.Show_Stu_Details()
elif choice==3:
student_data.Search_Stu_Details()
elif choice==4:
student_data.Delete_Stu_Details()
elif choice==5:
student_data.Edit_Stu_Details()
elif choice==6:
return
"""
#---------------------------------------------------------
# #1 Add Student Record | def Add_Records
#---------------------------------------------------------
import admission
import mysql.connector
import student_data
def Add_Records():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
rollno=int(input("Enter Rollno :"))
sname=input("Enter Student Name :")
add=input("Enter Address :")
Stream=input("Enter Stream:")
Query=("Insert into student_data
values(%s,%s,%s,%s)
Record=(rollno,sname,add,stream))
MyCur.execute(Query,Record)
MyCur.close()
MyCon.close()
print("Record has been Saved .. in Student Data Table....")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
MyCon.close()
#---------------------------------------------------------
# #2 Show Student Record | def Show_Stu_Details()
#---------------------------------------------------------
def Show_Stu_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
MyCur=mycon.cursor()
Query= (āSelect *from Student_Dataā)
MyCur.execute(Query)
for(rollno,sname,add,stream) in cursor:
print("Student Rollno ",rollno)
print("Student Name",name)
print("Address",add)
print("Stream",stream)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#-------------------------------------------------------------------------
# #3 Search Student Record | def Search_Stu_Details()
#---------------------------------------------------------------------
def Search_Stu_Details():
try:
mycon=connection.MySQLConnection (user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Student_data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,add,stream) in cursor:
print("Student Rollno ",rollno)
print("Student Name",name)
print("Address",add)
print("Stream",stream)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#-------------------------------------------------------------------------
# #4 Delete Student Record | def Delete_Stu_Details()
#---------------------------------------------------------------------
def Delete_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number
to be Delete :ā)
MyCur=mycon.cursor()
Query= (ā ā ā Delete from Student_Data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
print("Record has been deleted Now ")
#-------------------------------------------------------------------
# #5 Edit Student Record | def Edit_Stu_Details()
#---------------------------------------------------------------------
def Edit_Admin_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number
to be Update / Edit :ā)
Query= (ā ā ā Select *from Student_Data
where temp_rollno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_rollno,)
print("Input New Data ")
name=input("Enter Student Name :")
add=input("Enter Address :")
stream=input("Enter Stream")
Q=("Update student_data set name="%s",add="%s",
stream="%s" where temp_rollno="%s")
D=(name,add,stream)
MyCur.execute(Q,D)
print("Record has been updated Now")
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid
print("Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#------------------end of Student Data Menu ---------------------------------------
#-----------------------------------------------------------------------------------
# Learn
#
# print("\t\t-------------------------------------------------------------------------")
# print("\n\t\t * * ** STUDENT FEE M E N U * * ** ")
# print("\t\t-------------------------------------------------------------------------")
# print("1 : Fee Deposit ")
# print("2 : Fee Details")
# print("3 : return to Main Menu..")
#-----------------------------------------------------------------------------------
def Fee_Deposit():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Rollno Number:ā)
Query= (ā ā ā Select *from Student_Data
where temp_rollno= ā%sā)
MyCur=mycon.cursor()
rec_srch=(temp_rollno,)
fees=int(input("Enter Deposit Fees"))
Q=("Update student_data set fees="%f"
where temp_rollno="%s")
D=(fees)
MyCur.execute(Q,D)
print(" ! Fees has been Deposited !")
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
#Fee Details
#----------------------------------------------------------------------------------------------
def Fee_Details():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number to be Search :ā)
MyCur=mycon.cursor()
Query= (āSelect *from Student_data
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1) in cursor:
print("Student Rollno",rollno)
print("Student Class ",class1)
print("Name & Fees" ,sname, Fees)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
# Next & Last MENU
#Library Details
#print("\t\t-------------------------------------------------------------------------")
#print("\n\t\t * * ** Library M E N U * * ** ")
#print("\t\t-------------------------------------------------------------------------")
#print("1 : Book Issue ")
#print("2 : Book Return")
#print("3 : return to Main Menu..")
#print("\t\t-------------------------------------------------------------------------")
#----------------------------------------------------------------------------------------------
def book_issue():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number :ā)
MyCur=mycon.cursor()
Query= (āSelect *from library
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1,bname,issuedate) in cursor:
print("Student Rollno",rollno)
print("Student Name ",name)
print("Book Name " ,bname)
print("Book Issue Date" ,issuedate)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
#----------------------------------------------------------------------------------------------
def book_return():
try:
mycon=connection.MySQLConnection
(user='root',password=' ',host='localhost',
database='schoolmgm')
temp_rollno=input(āEnter Roll Number :ā)
MyCur=mycon.cursor()
Query= (āSelect *from library
where temp_rollno= ā%sā)
rec_srch=(temp_rollno,)
MyCur.execute(Query,rec_srch)
for(rollno,sname,class1,bname,returndate) in cursor:
print("Student Rollno",rollno)
print("Student Name ",name)
print("Book Name " ,bname)
print("Book Return Date" ,returndate)
Mycur.close() Con.close()
except mysql.connector.error as err:
if err.errno==errorcode.ER_ACCESS_DENIED_ERROR:
print("Oops! Something is invalid ...Re.Check User Name & Password........")
if err.errno==errorcode.ER_BAD_DB_ERROR:
print("Admission /SchoolMgm: DATABASE does not exists...try another DB")
else:
print(err)
mycur.close()
mycon.close()
# -- End of Project --------------------------#
download at
www.ramkohli.blogspot.in
#-------------------------------------------------------#
Thank you
ReplyDelete