College Management System in Python with Source Code
The College Management System in Python is developed in python programming language and it is a desktop application. This system is created using tkinter and graphical user interface. The College Management System has sqlite3 database and free to download the open source code.
This College Management System have a features it includes menu, student profile, library management system and marksheet. Talking approximately the system, it includes all of the required features which consist of adding, viewing, deleting, updating, searching and looking a student information lists.
Watch here the full running College management System in Python With Source Code
Anyway if you want level up your knowledge in programming especially games in python, try this new article I’ve made for you Code For Game in Python: Python Game Projects With Source Code
Before you start creating this College Management System in Python, make sure that you have PyCharm IDE and SQLite3 installed in your computer.
Steps on how to create College Management System in Python
College Management System in Python with Source Code
- Step 1: Create a project name
First when you finished installed the Pycharm IDE in your computer, open it and then create a “project name” after creating a project name click the “create” button.
- Step 2: Create a python file.
Second after creating a project name, “right click” your project name and then click “new” after that click the “python file“.
- Step 3: Name your python file.
Third after creating a python file, Name your python file after that click “enter“.
- Step 4: The actual code.
This is the actual coding on how to create College Management System in Python, and you are free to copy this code and download the full source code given below.
Importing Tkinter Module
Tkinter is the standard GUI library for Python. Python when combined with Tkinter provides a fast and easy way to create GUI applications.
1 |
from tkinter import* |
Importing the Sqlite3 Module
SQLite is a C library that provides a lightweight disk-based database that doesn’t require a separate server process and allows accessing the database using a nonstandard variant of the SQL query language.
1 |
import sqlite3 |
This module is for the design of menu
In the code given below, which is for the design of main menu of the system. The menu of college management system consist of student profile, fee report library system and a marksheet.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
from tkinter import* import random import os def __marksheet__(): filename = 'College_Search_Page.py' os.system(filename) os.system('notepad'+filename) def __Library__(): filename = 'College_Library_Frontend.py' os.system(filename) os.system('notepad'+filename) def __information__(): filename = 'College_Std_info_FrontEnd.py' os.system(filename) os.system('notepad'+filename) def __FeeReport__(): filename = 'College_Fee_Frontend.py' os.system(filename) os.system('notepad'+filename) def menu(): root = Tk() root.title('Menu') root.geometry('1350x750') root.config(bg = 'navajo white') Menu_title_Frame = LabelFrame(root, font = ('arial',50,'bold'), width = 1000, height = 100, bg = 'navajo white', relief = 'raise', bd = 13) Menu_title_Frame.grid(row = 0, column = 0, pady = 50) Menu_title_Label = Label(Menu_title_Frame, text = 'MENU', font = ('arial',30,'bold'), bg = 'navajo white') Menu_title_Label.grid(row = 0, column = 0, padx = 150) Menu_Frame_1 = LabelFrame(root, font = ('arial',17,'bold'), width = 1000, height = 100, bg = 'navajo white', relief = 'ridge', bd = 10) Menu_Frame_1.grid(row = 1, column = 0, padx = 280) Menu_Frame_2 = LabelFrame(root, font = ('arial',17,'bold'), width = 1000, height = 100, bg = 'navajo white', relief = 'ridge', bd = 10) Menu_Frame_2.grid(row = 2, column = 0, padx = 130, pady = 7) Menu_Frame_3 = LabelFrame(root, font = ('arial',17,'bold'), width = 1000, height = 100, bg = 'navajo white', relief = 'ridge', bd = 10) Menu_Frame_3.grid(row = 3, column = 0, pady = 7) Menu_Frame_4 = LabelFrame(root, font = ('arial',17,'bold'), width = 1000, height = 100, bg = 'navajo white', relief = 'ridge', bd = 10) Menu_Frame_4.grid(row = 4, column = 0, pady = 7) Label_1_STUDENTINFO = Label(Menu_Frame_1, text = 'STUDENT PROFILE', font = ('arial',25,'bold'), bg = 'navajo white') Label_1_STUDENTINFO.grid(row = 0, column = 0, padx = 50, pady = 5) Label_2_FEEREPORT = Label(Menu_Frame_2, text = 'FEE REPORT', font = ('arial',25,'bold'), bg = 'navajo white') Label_2_FEEREPORT.grid(row = 0, column = 0, padx = 100, pady = 5) Label_3_LIBRARYSYSTEM = Label(Menu_Frame_3, text = 'LIBRARY SYSTEM', font = ('arial',25,'bold'), bg = 'navajo white') Label_3_LIBRARYSYSTEM.grid(row = 0, column = 0, padx = 60, pady = 5) Label_4_MARKSHEET = Label(Menu_Frame_4, text = 'MARKSHEET', font = ('arial',25,'bold'), bg = 'navajo white') Label_4_MARKSHEET.grid(row = 0, column = 0, padx = 101, pady = 5) Button_1_VIEWINFO = Button(Menu_Frame_1, text = 'VIEW', font = ('arial',16,'bold'), width = 8, command = __information__) Button_1_VIEWINFO.grid(row = 0, column = 3, padx = 50) Button_2_VIEWREPORT = Button(Menu_Frame_2, text = 'VIEW', font = ('arial',16,'bold'), width = 8, command = __FeeReport__) Button_2_VIEWREPORT.grid(row = 0, column = 3, padx = 50) Button_3_VIEWLIBRARY = Button(Menu_Frame_3, text = 'VIEW', font = ('arial',16,'bold'), width = 8, command = __Library__) Button_3_VIEWLIBRARY.grid(row = 0, column = 3, padx = 50) Button_4_VIEWMARKSHEET = Button(Menu_Frame_4, text = 'VIEW', font = ('arial',16,'bold'), width = 8, command = __marksheet__) Button_4_VIEWMARKSHEET.grid(row = 0, column = 3, padx = 50) root.mainloop() if __name__ == '__main__': menu() |
This module is for the student profile
In the code given below, which is for the function of student profile. In the student profile you can see all the details of a student data. Also you can add, view, search, update, and delete a student data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
from tkinter import* import tkinter.messagebox import random import College_Std_info_BackEnd from tkinter import ttk class Student_Information(): def __init__(self, master): self.master = master self.master.title('Student Information') self.master.geometry('1350x750') self.master.config(bg = 'navajowhite') def information(): self.name = StringVar() self.father_name = StringVar() self.mother_name = StringVar() self.address = StringVar() self.mobileno = StringVar() self.email_address = StringVar() self.date_of_birth = StringVar() self.gender = StringVar() def Student_Record(event): try: global selected_tuple index = self.listbox.curselection()[0] selected_tuple = self.listbox.get(index) self.Text_Entry_name.delete(0, END) self.Text_Entry_name.insert(END, selected_tuple[1]) self.Text_Entry_Father_Name.delete(0, END) self.Text_Entry_Father_Name.insert(END, selected_tuple[2]) self.Text_Entry_Mother_Name.delete(0, END) self.Text_Entry_Mother_Name.insert(END, selected_tuple[3]) self.Text_Entry_address.delete(0, END) self.Text_Entry_address.insert(END, selected_tuple[4]) self.Text_Entry_mobileno.delete(0, END) self.Text_Entry_mobileno.insert(END, selected_tuple[5]) self.Text_Entry_email_address.delete(0, END) self.Text_Entry_email_address.insert(END, selected_tuple[6]) self.Text_Entry_date_of_birth.delete(0, END) self.Text_Entry_date_of_birth.insert(END, selected_tuple[7]) self.Text_Entry_gender.delete(0, END) self.Text_Entry_gender.insert(END, selected_tuple[8]) except IndexError: pass def Add(): if(len(self.name.get()) != 0): College_Std_info_BackEnd.insert(self.name.get(), self.father_name.get(), self.mother_name.get(), self.address.get(), self.mobileno.get(), self.email_address.get(), self.date_of_birth.get(), \ self.gender.get()) self.listbox.delete(0, END) self.listbox.insert(END, (self.name.get(), self.father_name.get(), self.mother_name.get(), self.address.get(), self.mobileno.get(), self.email_address.get(), self.date_of_birth.get(), \ self.gender.get())) def Display(): self.listbox.delete(0, END) for row in College_Std_info_BackEnd.view(): self.listbox.insert(END, row, str(' ')) def Exit(): Exit = tkinter.messagebox.askyesno("Login System", "Confirm if you want to Exit") if Exit > 0: self.master.destroy() return def Reset(): self.name.set('') self.father_name.set('') self.mother_name.set('') self.address.set('') self.mobileno.set('') self.email_address.set('') self.date_of_birth.set('') self.gender.set('') self.listbox.delete(0, END) def Delete(): if(len(self.name.get()) != 0): College_Std_info_BackEnd.delete(selected_tuple[0]) Reset() Display() def Search(): self.listbox.delete(0, END) for row in College_Std_info_BackEnd.search(self.name.get(), self.father_name.get(), self.mother_name.get(), self.address.get(), self.mobileno.get(), self.email_address.get(), self.date_of_birth.get(), self.gender.get()): self.listbox.insert(END, row, str(' ')) def Update(): if(len(self.name.get()) != 0): College_Std_info_BackEnd.delete(selected_tuple[0]) if(len(self.name.get()) != 0): College_Std_info_BackEnd.insert(self.name.get(), self.father_name.get(), self.mother_name.get(), self.address.get(), self.mobileno.get(), self.email_address.get(), self.date_of_birth.get(), \ self.gender.get()) self.listbox.delete(0, END) self.listbox.insert(END, (self.name.get(), self.father_name.get(), self.mother_name.get(), self.address.get(), self.mobileno.get(), self.email_address.get(), self.date_of_birth.get(), \ self.gender.get())) self.Student_Main_Frame = LabelFrame(self.master, width = 1300, height = 500, font = ('arial', 20, 'bold'), \ bg = 'navajowhite', bd = 15, relief = 'ridge') self.Student_Main_Frame.grid(row = 0, column = 0, padx = 10, pady = 20) self.Student_Frame_1 = LabelFrame(self.Student_Main_Frame, width = 600, height = 400, font = ('arial', 15, 'bold'), \ relief = 'ridge', bd = 10, bg = 'navajowhite', text = 'STUDENT INFORMATION ') self.Student_Frame_1.grid(row = 1, column = 0, padx = 10) self.Student_Frame_2 = LabelFrame(self.Student_Main_Frame, width = 750, height = 400, font = ('arial', 15, 'bold'), \ relief = 'ridge', bd = 10, bg = 'navajowhite', text = 'STUDENT DATABASE') self.Student_Frame_2.grid(row = 1, column = 1, padx = 5) self.Student_Frame_3 = LabelFrame(self.master, width = 1200, height = 100, font = ('arial', 10, 'bold'), \ bg = 'navajowhite', relief = 'ridge', bd = 13) self.Student_Frame_3.grid(row = 2, column = 0, pady = 10) self.lbl_Name = Label(self.Student_Frame_1, text ='Name', font = ('arial', 20, 'bold'), bg ='navajowhite') self.lbl_Name.grid(row = 0, column = 0, sticky = W, padx = 20, pady = 10) self.lbl_father_name = Label(self.Student_Frame_1, text ='Father Name', font = ('arial', 20, 'bold'), bg ='navajowhite') self.lbl_father_name.grid(row = 1, column = 0, sticky = W, padx = 20) self.lbl_mother_name = Label(self.Student_Frame_1, text ='Mother Name', font = ('arial', 20, 'bold'), bg ='navajowhite') self.lbl_mother_name.grid(row = 2, column = 0, sticky = W, padx = 20) self.lbl_address = Label(self.Student_Frame_1, text ='Address', font = ('arial', 20, 'bold'), bg ='navajowhite') self.lbl_address.grid(row = 3, column = 0, sticky = W, padx = 20) self.lbl_mobileno = Label(self.Student_Frame_1, text ='Mobile Number', font = ('arial', 20, 'bold'), bg ='navajowhite') self.lbl_mobileno.grid(row = 4, column = 0, sticky = W, padx = 20) self.lbl_email_address = Label(self.Student_Frame_1, text ='Email Address', font = ('arial', 20, 'bold'), bg ='navajowhite') self.lbl_email_address.grid(row = 5, column = 0, sticky = W, padx = 20) self.lbl_dateOf_birth = Label(self.Student_Frame_1, text ='Date of Birth', font = ('arial', 20, 'bold'), bg ='navajowhite') self.lbl_dateOf_birth.grid(row = 6, column = 0, sticky = W, padx = 20) self.lbl_gender = Label(self.Student_Frame_1, text ='Gender', font = ('arial', 20, 'bold'), bg ='navajowhite') self.lbl_gender.grid(row = 7, column = 0, sticky = W, padx = 20, pady = 10) self.Text_Entry_name = Entry(self.Student_Frame_1, font = ('arial', 17, 'bold'), textvariable = self.name) self.Text_Entry_name.grid(row = 0, column = 1, padx = 10, pady = 5) self.Text_Entry_Father_Name = Entry(self.Student_Frame_1, font = ('arial', 17, 'bold'), textvariable = self.father_name) self.Text_Entry_Father_Name.grid(row = 1, column = 1, padx = 10, pady = 5) self.Text_Entry_Mother_Name = Entry(self.Student_Frame_1, font = ('arial', 17, 'bold'), textvariable = self.mother_name) self.Text_Entry_Mother_Name.grid(row = 2, column = 1, padx = 10, pady = 5) self.Text_Entry_address = Entry(self.Student_Frame_1, font = ('arial', 17, 'bold'), textvariable = self.address) self.Text_Entry_address.grid(row = 3, column = 1, padx = 10, pady = 5) self.Text_Entry_mobileno = Entry(self.Student_Frame_1, font = ('arial', 17, 'bold'), textvariable = self.mobileno) self.Text_Entry_mobileno.grid(row = 4, column = 1, padx = 10, pady = 5) self.Text_Entry_email_address = Entry(self.Student_Frame_1, font = ('arial', 17, 'bold'), textvariable = self.email_address) self.Text_Entry_email_address.grid(row = 5, column = 1, padx = 10, pady = 5) self.Text_Entry_date_of_birth = Entry(self.Student_Frame_1, font = ('arial', 17, 'bold'), textvariable = self.date_of_birth) self.Text_Entry_date_of_birth.grid(row = 6, column = 1, padx = 10, pady = 5) self.Text_Entry_gender = ttk.Combobox(self.Student_Frame_1, values = (' ', 'Male', 'Female', 'Others'), \ font = ('arial',17,'bold'), textvariable = self.gender, width = 19) self.Text_Entry_gender.grid(row = 7, column = 1, padx = 10, pady = 5) self.SAVE_BUTTON = Button(self.Student_Frame_3, text ='SAVE', font = ('arial', 17, 'bold'), width = 8, command = Add) self.SAVE_BUTTON.grid(row = 0, column = 0, padx = 10, pady = 10) self.BUTTON_DISPLAY = Button(self.Student_Frame_3, text ='DISPLAY', font = ('arial', 17, 'bold'), width = 8, command = Display) self.BUTTON_DISPLAY.grid(row = 0, column = 1, padx = 10, pady = 10) self.BUTTON_RESET = Button(self.Student_Frame_3, text ='RESET', font = ('arial', 17, 'bold'), width = 8, command = Reset) self.BUTTON_RESET.grid(row = 0, column = 2, padx = 10, pady = 10) self.BUTTON_UPDATE = Button(self.Student_Frame_3, text ='UPDATE', font = ('arial', 17, 'bold'), width = 8, command = Update) self.BUTTON_UPDATE.grid(row = 0, column = 3, padx = 10, pady = 10) self.BUTTON_DELETE = Button(self.Student_Frame_3, text ='DELETE', font = ('arial', 17, 'bold'), width = 8, command = Delete) self.BUTTON_DELETE.grid(row = 0, column = 4, padx = 10, pady = 10) self.BUTTON_SEARCH = Button(self.Student_Frame_3, text ='SEARCH', font = ('arial', 17, 'bold'), width = 8, command = Search) self.BUTTON_SEARCH.grid(row = 0, column = 5, padx = 10, pady = 10) self.BUTTON_EXIT = Button(self.Student_Frame_3, text ='EXIT', font = ('arial', 17, 'bold'), width = 8, command = Exit) self.BUTTON_EXIT.grid(row = 0, column = 6, padx = 10, pady = 10) self.scrollbar = Scrollbar(self.Student_Frame_2) self.scrollbar.grid(row = 0, column = 1, sticky = 'ns') self.listbox = Listbox(self.Student_Frame_2, width = 75, height = 20, font = ('arial', 12, 'bold')) self.listbox.bind('<<ListboxSelect>>', Student_Record) self.listbox.grid(row = 0, column = 0) self.scrollbar.config(command = self.listbox.yview) information() root = Tk() obj = Student_Information(root) root.mainloop() |
This module is for the fee report
In the code given below, which is for the function of fee report. In the fee report you can add, view, search, update, and delete, and you can also see the design of fee report.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
from tkinter import* from tkinter import ttk import tkinter.messagebox import datetime import College_Fee_Backend class college_fee(): def __init__(self, master): self.master = master self.master.title('Fee Report') self.master.geometry('1350x750') self.master.config(bg='Navajo white') self.receipts = StringVar() self.name = StringVar() self.admin = StringVar() self.date = StringVar() self.branch = StringVar() self.semister = StringVar() self.total = DoubleVar() self.paid = DoubleVar() self.due = DoubleVar() def Tuple(event): try: global studentInfo index = self.list.curselection()[0] studentInfo = self.list.get(index) self.receipts_entry.delete(0, END) self.receipts_entry.insert(END, studentInfo[1]) self.studentname_entry.delete(0, END) self.studentname_entry.insert(END, studentInfo[2]) self.collegeAdmin_entry.delete(0, END) self.collegeAdmin_entry.insert(END, studentInfo[3]) self.Date_entry.delete(0, END) self.Date_entry.insert(END, studentInfo[4]) self.collegeBranch_entry.delete(0, END) self.collegeBranch_entry.insert(END, studentInfo[5]) self.semister_entry.delete(0, END) self.semister_entry.insert(END, studentInfo[6]) self.tot_entry.delete(0, END) self.tot_entry.insert(END, studentInfo[7]) self.moneyPaid_entry.delete(0, END) self.moneyPaid_entry.insert(END, studentInfo[8]) self.studdenDdue_entry.delete(0, END) self.studdenDdue_entry.insert(END, studentInfo[9]) except IndexError: pass def Insert(): if (len(self.admin.get()) != 0): College_Fee_Backend.insert(self.receipts.get(), self.name.get(), self.admin.get(), self.date.get(), self.branch.get(), self.semister.get(), self.total.get(), self.paid.get(), self.due.get()) self.list.delete(0, END) self.list.insert(END, (self.receipts.get(), self.name.get(), self.admin.get(), self.date.get(), self.branch.get(), self.semister.get(), self.total.get(), self.paid.get(), self.due.get())) def View(): self.list.delete(0, END) for row in College_Fee_Backend.view(): self.list.insert(END, row, str(' ')) def Reset(): self.receipts.set(' ') self.name.set(' ') self.admin.set(' ') #self.date.set(' ') self.branch.set(' ') self.semister.set(' ') self.paid.set(' ') self.due.set(' ') self.Display.delete('1.0', END) self.list.delete(0, END) def Delete(): College_Fee_Backend.delete(studentInfo[0]) Reset() View() def Receipt(): self.Display.delete('1.0', END) self.Display.insert(END, '\t\tRECEIPT' + '\n\n') self.Display.insert( END, '\tReceipt No.\t :' + self.receipts.get() + '\n') self.Display.insert(END, '\tStudent Name :' + self.name.get() + '\n') self.Display.insert(END, '\tAdmission No.\t:' + self.admin.get() + '\n') self.Display.insert( END, '\tDate\t :' + self.date.get() + '\n') self.Display.insert( END, '\tBranch\t :' + self.branch.get() + '\n') self.Display.insert( END, '\tSemester \t :' + self.semister.get() + '\n\n') x1 = (self.var_1.get()) x2 = (self.paid.get()) x3 = (x1 - x2) self.Display.insert(END, '\tTotal Amount :' + str(x1) + '\n') self.Display.insert(END, '\tPaid Amount :' + str(x2) + '\n') self.Display.insert(END, '\tBalance\t :' + str(x3) + '\n') self.due.set(x3) def Search(): self.list.delete(0, END) for row in College_Fee_Backend.search(self.receipts.get(), self.name.get(), self.admin.get(), self.date.get(), self.branch.get(), self.semister.get(), self.total.get(), self.paid.get(), self.due.get()): self.list.insert(END, row, str(' ')) def Update(): College_Fee_Backend.delete(studentInfo[0]) Insert() def Exit(): Exit = tkinter.messagebox.askyesno( 'Attention', 'Confirm, if you want to Exit') if Exit > 0: root.destroy() return College_Main_Frame = Frame(self.master, bg='Navajo white') College_Main_Frame.grid() College_Title_Frame = LabelFrame( College_Main_Frame, width=1350, height=100, bg='Navajo white', relief='ridge', bd=15) College_Title_Frame.pack(side=TOP) self.lblTitle = Label(College_Title_Frame, font=('arial', 40, 'bold'), text='FEE REPORT', bg='navajowhite', padx=13) self.lblTitle.grid(padx=400) College_Data_Frame = Frame(College_Main_Frame, width=1350, height=350, bg='Navajo white', relief='ridge', bd=15) College_Data_Frame.pack(side=TOP, padx=15) College_Frame_1 = LabelFrame(College_Data_Frame, width=850, height=350, bg='Navajo white', relief='ridge', bd=8, text='Informations', font=('arial', 15, 'bold')) College_Frame_1.pack(side=LEFT, padx=10) College_Frame_2 = LabelFrame(College_Data_Frame, width=495, height=350, bg='Navajo white', relief='ridge', bd=8, text='Fee Receipt', font=('arial', 15, 'bold')) College_Frame_2.pack(side=RIGHT, padx=10) College_List_Frame = Frame(College_Main_Frame, width=1350, height=150, bg='Navajo white', relief='ridge', bd=15) College_List_Frame.pack(side=TOP, padx=15) Btn_Frame = Frame(College_Main_Frame, width=1350, height=80, bg='Navajo white', relief='ridge', bd=15) Btn_Frame.pack(side=TOP) self.receipts_lbl = Label(College_Frame_1, text='Receipt No. : ', font=( 'arial', 14, 'bold'), bg='Navajo white') self.receipts_lbl.grid(row=0, column=0, padx=15, sticky=W) self.studentName_lbl = Label(College_Frame_1, text='Student Name : ', font=( 'arial', 14, 'bold'), bg='Navajo white') self.studentName_lbl.grid(row=1, column=0, padx=15, sticky=W) self.collegeAdmin_lbl = Label(College_Frame_1, text='Admission No. : ', font=( 'arial', 14, 'bold'), bg='Navajo white') self.collegeAdmin_lbl.grid(row=2, column=0, padx=15, sticky=W) self.Date_lbl = Label(College_Frame_1, text='Date : ', font=( 'arial', 14, 'bold'), bg='Navajo white') self.Date_lbl.grid(row=3, column=0, padx=15, sticky=W) self.college_branch_lbl = Label(College_Frame_1, text='Branch : ', font=( 'arial', 14, 'bold'), bg='Navajo white') self.college_branch_lbl.grid(row=4, column=0, padx=15, sticky=W) self.semister_lbl = Label(College_Frame_1, text='Semester : ', font=( 'arial', 14, 'bold'), bg='Navajo white') self.semister_lbl.grid(row=5, column=0, padx=15, sticky=W) self.total_lbl = Label(College_Frame_1, text='TOTAL AMOUNT : ', font=( 'arial', 14, 'bold'), bg='Navajo white') self.total_lbl.grid(row=2, column=2, padx=5, sticky=W) self.paid_lbl = Label(College_Frame_1, text='PAID AMOUNT : ', font=( 'arial', 14, 'bold'), bg='Navajo white') self.paid_lbl.grid(row=3, column=2, padx=5, sticky=W) self.due_lbl = Label(College_Frame_1, text='BALANCE : ', font=( 'arial', 14, 'bold'), bg='Navajo white') self.due_lbl.grid(row=4, column=2, padx=5, sticky=W) self.var_1 = DoubleVar(College_Frame_1, value='36265') d1 = datetime.date.today() self.date.set(d1) self.receipts_entry = Entry(College_Frame_1, font=( 'arial', 14), textvariable=self.receipts) self.receipts_entry.grid(row=0, column=1, padx=15, pady=5) self.studentname_entry = Entry(College_Frame_1, font=( 'arial', 14), textvariable=self.name) self.studentname_entry.grid(row=1, column=1, padx=15, pady=5) self.collegeAdmin_entry = Entry(College_Frame_1, font=( 'arial', 14), textvariable=self.admin) self.collegeAdmin_entry.grid(row=2, column=1, padx=15, pady=5) self.Date_entry = Entry(College_Frame_1, font=( 'arial', 14), textvariable=self.date) self.Date_entry.grid(row=3, column=1, padx=15, pady=5) self.collegeBranch_entry = ttk.Combobox(College_Frame_1, values=(' ', 'CSE', 'IT', 'ETC/ET&T', 'Mechanical Engineer', 'Civil Engineer', 'IT/CT', 'Electrical Engineer'), font=('arial', 14), width=19, textvariable=self.branch) self.collegeBranch_entry.grid(row=4, column=1, padx=15, pady=5) self.semister_entry = ttk.Combobox(College_Frame_1, values=(' ', 'FIRST', 'SECOND', 'THIRD'), font=('arial', 14), width=19, textvariable=self.semister) self.semister_entry.grid(row=5, column=1, padx=15, pady=5) self.tot_entry = Entry(College_Frame_1, font=( 'arial', 14), width=10, textvariable=self.var_1, state='readonly') self.tot_entry.grid(row=2, column=3, padx=8, pady=5) self.moneyPaid_entry = Entry(College_Frame_1, font=( 'arial', 14), width=10, textvariable=self.paid) self.moneyPaid_entry.grid(row=3, column=3, pady=5) self.studdenDdue_entry = Entry(College_Frame_1, font=( 'arial', 14), width=10, textvariable=self.due) self.studdenDdue_entry.grid(row=4, column=3, pady=7) self.Display = Text(College_Frame_2, width=42, height=12, font=('arial', 14, 'bold')) self.Display.grid(row=0, column=0, padx=3) sb = Scrollbar(College_List_Frame) sb.grid(row=0, column=1, sticky='ns') self.list = Listbox(College_List_Frame, font=( 'arial', 13, 'bold'), width=140, height=8) self.list.bind('<<ListboxSelect>>', Tuple) self.list.grid(row=0, column=0) sb.config(command=self.list.yview) button_Save = Button(Btn_Frame, text='SAVE', font=( 'arial', 14, 'bold'), width=10, command=Insert) button_Save.grid(row=0, column=0, padx=5, pady=5) button_display = Button(Btn_Frame, text='DISPLAY', font=( 'arial', 14, 'bold'), width=10, command=View) button_display.grid(row=0, column=1, padx=5, pady=5) button_Reset = Button(Btn_Frame, text='RESET', font=( 'arial', 14, 'bold'), width=10, command=Reset) button_Reset.grid(row=0, column=2, padx=5, pady=5) button_Reset = Button(Btn_Frame, text='UPDATE', font=( 'arial', 14, 'bold'), width=10, command=Update) button_Reset.grid(row=0, column=3, padx=5, pady=5) button_Search = Button(Btn_Frame, text='SEARCH', font=( 'arial', 14, 'bold'), width=10, command=Search) button_Search.grid(row=0, column=4, padx=5, pady=5) button_Delete = Button(Btn_Frame, text='DELETE', font=( 'arial', 14, 'bold'), width=10, command=Delete) button_Delete.grid(row=0, column=5, padx=5, pady=5) button_Receipt = Button(Btn_Frame, text='RECEIPT', font=( 'arial', 14, 'bold'), width=10, command=Receipt) button_Receipt.grid(row=0, column=6, padx=5, pady=5) button_Exit = Button(Btn_Frame, text='EXIT', font=( 'arial', 14, 'bold'), width=10, command=Exit) button_Exit.grid(row=0, column=7, padx=5, pady=5) root = Tk() obj = college_fee(root) root.mainloop() |
This module is for the library system
In the code given below, which is for the function of library management system. The library management system we can see all the gave book-related subtitles. It moreover gives a book issue include where we can check all the current books and issue them. It is also includes the design window of library system.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
from tkinter import* from tkinter import ttk import random from datetime import datetime import tkinter.messagebox import College_Library_Backend class Library: def __init__(self, root): self.root = root self.root.title('Library Management System') self.root.geometry('1350x750') self.root.config(bg = 'navajowhite') self.Mbtype = StringVar() self.referenceno = StringVar() self.firstname = StringVar() self.lastname = StringVar() self.address = StringVar() self.post = StringVar() self.mobileno = StringVar() self.ID = StringVar() self.title = StringVar() self.author = StringVar() self.borrow = StringVar() self.due = StringVar() self.loan = StringVar() self.yr_of_pub = StringVar() self.editions = StringVar() def BookRec(event): try: global selected_tuple index = self.List_bx_2.curselection()[0] selected_tuple = self.List_bx_2.get(index) self.txt_Entry_0.delete(0, END) self.txt_Entry_0.insert(END, selected_tuple[1]) self.txt_Entry_1.delete(0, END) self.txt_Entry_1.insert(END, selected_tuple[2]) self.txt_Entry_2.delete(0, END) self.txt_Entry_2.insert(END, selected_tuple[3]) self.txt_Entry_3.delete(0, END) self.txt_Entry_3.insert(END, selected_tuple[4]) self.txt_Entry_4.delete(0, END) self.txt_Entry_4.insert(END, selected_tuple[5]) self.txt_Entry_5.delete(0, END) self.txt_Entry_5.insert(END, selected_tuple[6]) self.txt_Entry_6.delete(0, END) self.txt_Entry_6.insert(END, selected_tuple[7]) self.txt_Entry_7.delete(0, END) self.txt_Entry_7.insert(END, selected_tuple[8]) self.txt_Entry_8.delete(0, END) self.txt_Entry_8.insert(END, selected_tuple[9]) self.txt_Entry_9.delete(0, END) self.txt_Entry_9.insert(END, selected_tuple[10]) self.txt_Entry_10.delete(0, END) self.txt_Entry_10.insert(END, selected_tuple[11]) self.txt_Entry_11.delete(0, END) self.txt_Entry_11.insert(END, selected_tuple[12]) self.txt_Entry_12.delete(0, END) self.txt_Entry_12.insert(END, selected_tuple[13]) except IndexError: pass def Insert(): if(len(self.referenceno.get()) != 0): College_Library_Backend.insert(self.Mbtype.get(), self.referenceno.get(), self.firstname.get(), self.lastname.get() \ , self.address.get(), self.post.get(), self.mobileno.get(), self.ID.get() \ , self.title.get(), self.author.get(), self.borrow.get(), self.due.get() \ , self.loan.get()) self.List_bx_2.delete(0, END) self.List_bx_2.insert(END, (self.Mbtype.get(), self.referenceno.get(), self.firstname.get(), self.lastname.get()\ , self.address.get(), self.post.get(), self.mobileno.get(), self.ID.get()\ , self.title.get(), self.author.get(), self.borrow.get(), self.due.get()\ , self.loan.get())) def Display(): self.List_bx_2.delete(0, END) for row in College_Library_Backend.view(): self.List_bx_2.insert(END, row, str(' ')) def Exit(): Exit = tkinter.messagebox.askyesno('Library Management System','Confirm if you want to Exit') if Exit > 0: root.destroy() return def Reset(): self.Mbtype.set('') self.referenceno.set('') self.firstname.set('') self.lastname.set('') self.address.set('') self.post.set('') self.mobileno.set('') self.ID.set('') self.title.set('') self.author.set('') self.borrow.set('') self.due.set('') self.loan.set('') self.Display_Layout.delete('1.0', END) self.List_bx_2.delete(0, END) def Delete(): College_Library_Backend.delete(selected_tuple[0]) Reset() Display() def Update(): College_Library_Backend.delete(selected_tuple[0]) College_Library_Backend.insert(self.Mbtype.get(), self.referenceno.get(), self.firstname.get(), self.lastname.get() \ , self.address.get(), self.post.get(), self.mobileno.get(), self.ID.get() \ , self.title.get(), self.author.get(), self.borrow.get(), self.due.get() \ , self.loan.get()) self.List_bx_2.delete(0, END) self.List_bx_2.insert(END, (self.Mbtype.get(), self.referenceno.get(), self.firstname.get(), self.lastname.get()\ , self.address.get(), self.post.get(), self.mobileno.get(), self.ID.get()\ , self.title.get(), self.author.get(), self.borrow.get(), self.due.get()\ , self.loan.get())) def Search(): self.List_bx_2.delete(0, END) for row in College_Library_Backend.search(self.Mbtype.get(), self.referenceno.get(), self.firstname.get(), self.lastname.get()\ , self.address.get(), self.post.get(), self.mobileno.get(), self.ID.get()\ , self.title.get(), self.author.get(), self.borrow.get(), self.due.get()\ , self.loan.get()): self.List_bx_2.insert(END, row, str(' ')) def Details(): self.Display_Layout.delete('1.0', END) self.Display_Layout.insert(END, 'Book ID: ' + self.ID.get() + '\n') self.Display_Layout.insert(END, 'Title: ' + self.title.get() + '\n') self.Display_Layout.insert(END, 'Author: ' + self.author.get() + '\n') self.Display_Layout.insert(END, 'Edition: ' + self.editions.get() + '\n') self.Display_Layout.insert(END, 'Year of Published: \t' + self.yr_of_pub.get() + '\n') self.Display_Layout.insert(END, 'Date Borrowed: ' + self.borrow.get() + '\n') self.Display_Layout.insert(END, 'Date Due:' + self.due.get() + '\n') self.Display_Layout.insert(END, 'Days in Loan: ' + self.loan.get() + '\n') Library_Main_Frame = Frame(self.root, bg = 'navajowhite') Library_Main_Frame.grid() Library_Title_Frame_1 = Frame(Library_Main_Frame, width = 1350, bg = 'navajowhite', relief = RIDGE, bd = 15, padx = 20) Library_Title_Frame_1.pack(side = TOP) self.Library_lblTitle = Label(Library_Title_Frame_1, font = ('arial', 40, 'bold'), text ='\tLibrary Management System\t', \ bg = 'navajowhite', padx = 13) self.Library_lblTitle.grid() btn_Frame = Frame(Library_Main_Frame, width = 1350, height = 50, relief = RIDGE, bd = 10, bg = 'navajowhite') btn_Frame.pack(side = BOTTOM) Library_Detail_Frame = Frame(Library_Main_Frame, width = 1350, height = 100, relief = RIDGE, bd = 10, bg = 'navajowhite') Library_Detail_Frame.pack(side = BOTTOM) Library_Data_Frame = Frame(Library_Main_Frame, width = 1350, height = 400, relief = RIDGE, bd = 15, bg = 'navajowhite') Library_Data_Frame.pack(side = BOTTOM) Library_Frame_1 = LabelFrame(Library_Data_Frame, width = 800, height = 400, relief = RIDGE, bd = 10, bg = 'navajowhite', \ text = "Library Membership Info:", padx = 20, font = ('arial',15,'bold')) Library_Frame_1.pack(side = LEFT, padx = 3) Library_Frame_2 = LabelFrame(Library_Data_Frame, width = 550, height = 400, relief = RIDGE, bd = 10, bg = 'navajowhite', \ text = "Book Details:", padx = 20, font = ('arial',15,'bold')) Library_Frame_2.pack(side = RIGHT) self.memLabel_1 = Label(Library_Frame_1, text ='Member type', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.memLabel_1.grid(row = 0, column = 0, sticky = W) self.refLabel_2 = Label(Library_Frame_1, text ='Reference No.', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.refLabel_2.grid(row = 1, column = 0, sticky = W) self.firstnameLabel_3 = Label(Library_Frame_1, text ='First Name', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.firstnameLabel_3.grid(row = 2, column = 0, sticky = W) self.lastnameLabel_4 = Label(Library_Frame_1, text ='Last Name', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.lastnameLabel_4.grid(row = 3, column = 0, sticky = W) self.addressLabel_5 = Label(Library_Frame_1, text ='Address', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.addressLabel_5.grid(row = 4, column = 0, sticky = W) self.postcodeLabel_6 = Label(Library_Frame_1, text ='Post Code', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.postcodeLabel_6.grid(row = 5, column = 0, sticky = W) self.mobilenoLabel_7 = Label(Library_Frame_1, text ='Mobile No.', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.mobilenoLabel_7.grid(row = 6, column = 0, sticky = W) self.bookidLabel_8 = Label(Library_Frame_1, text ='Book ID', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.bookidLabel_8.grid(row = 0, column = 2, sticky = W) self.booktitleLabel_9 = Label(Library_Frame_1, text ='Book Title', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.booktitleLabel_9.grid(row = 1, column = 2, sticky = W) self.authorLabel_10 = Label(Library_Frame_1, text ='Author', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.authorLabel_10.grid(row = 2, column = 2, sticky = W) self.dateborrowedLabel_11 = Label(Library_Frame_1, text ='Date Borrowed', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.dateborrowedLabel_11.grid(row = 3, column = 2, sticky = W) self.dateLabel_13 = Label(Library_Frame_1, text ='Date Due', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.dateLabel_13.grid(row = 4, column = 2, sticky = W) self.dateLabel_13 = Label(Library_Frame_1, text ='Days in Loan', font = ('arial', 13, 'bold'), pady = 2, \ bg = 'navajowhite') self.dateLabel_13.grid(row = 5, column = 2, sticky = W) self.txt_Entry_0 = ttk.Combobox(Library_Frame_1, values = (' ', 'Student', 'Faculty', 'Staff Member'), \ font = ('arial',13,'bold'), width = 23, textvariable = self.Mbtype) self.txt_Entry_0.grid(row = 0, column = 1) self.txt_Entry_1 = Entry(Library_Frame_1, font = ('arial', 13, 'bold'), width = 25, textvariable = self.referenceno) self.txt_Entry_1.grid(row = 1, column = 1, padx = 15) self.txt_Entry_2 = Entry(Library_Frame_1, font = ('arial', 13, 'bold'), width = 25, textvariable = self.firstname) self.txt_Entry_2.grid(row = 2, column = 1, padx = 15) self.txt_Entry_3 = Entry(Library_Frame_1, font = ('arial', 13, 'bold'), width = 25, textvariable = self.lastname) self.txt_Entry_3.grid(row = 3, column = 1, padx = 15) self.txt_Entry_4 = Entry(Library_Frame_1, font = ('arial', 13, 'bold'), width = 25, textvariable = self.address) self.txt_Entry_4.grid(row = 4, column = 1, padx = 15) self.txt_Entry_5 = Entry(Library_Frame_1, font = ('arial', 13, 'bold'), width = 25, textvariable = self.post) self.txt_Entry_5.grid(row = 5, column = 1, padx = 15) self.txt_Entry_6 = Entry(Library_Frame_1, font = ('arial', 13, 'bold'), width = 25, textvariable = self.mobileno) self.txt_Entry_6.grid(row = 6, column = 1, padx = 15) self.txt_Entry_7 = Entry(Library_Frame_1, font = ('arial', 13, 'bold'), width = 25, textvariable = self.ID) self.txt_Entry_7.grid(row = 0, column = 4, padx = 15) self.txt_Entry_8 = Entry(Library_Frame_1, font = ('arial', 13, 'bold'), width = 25, textvariable = self.title) self.txt_Entry_8.grid(row = 1, column = 4, padx = 15) self.txt_Entry_9 = Entry(Library_Frame_1, font = ('arial', 13, 'bold'), width = 25, textvariable = self.author) self.txt_Entry_9.grid(row = 2, column = 4, padx = 15) self.txt_Entry_10 = Entry(Library_Frame_1, font = ('arial', 13, 'bold'), width = 25, textvariable = self.borrow) self.txt_Entry_10.grid(row = 3, column = 4, padx = 15) self.txt_Entry_11 = Entry(Library_Frame_1, font = ('arial', 13, 'bold'), width = 25, textvariable = self.due) self.txt_Entry_11.grid(row = 4, column = 4, padx = 15) self.txt_Entry_12 = Entry(Library_Frame_1, font = ('arial', 13, 'bold'), width = 25, textvariable = self.loan) self.txt_Entry_12.grid(row = 5, column = 4, padx = 15) self.Display_Layout = Text(Library_Frame_2, font = ('arial', 13, 'bold'), width = 28, height = 11) self.Display_Layout.grid(row = 0, column = 2) List_of_Books = [' C',' C++',' Java',' Python',' PHP',' Java Script',' My SQL',' Data Structure',' Linux',\ ' Operating System',' Web Developement',' Data Science',' Algorithms',' Android', \ ' VB.net'] def SelectedBook(event): value_List = str(self.List_bx_1.get(self.List_bx_1.curselection())) val = value_List if (val == ' C'): self.ID.set('ISBN 525341') self.title.set('Programming using C') self.author.set('Gail Guzon') self.yr_of_pub.set('2019') self.editions.set('5th') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 14) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('14') self.due.set(days3) Details() elif (val == ' C++'): self.ID.set('ISBN 345687') self.title.set('Programming using C++') self.author.set('Armel Maningo') self.yr_of_pub.set('2019') self.editions.set('4th') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 10) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('10') self.due.set(days3) Details() elif (val == ' Java'): self.ID.set('ISBN 643842') self.title.set('Java Programming') self.author.set('Romeo Tanate') self.yr_of_pub.set('2019') self.editions.set('7th') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 13) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('13') self.due.set(days3) Details() elif (val == ' Python'): self.ID.set('ISBN 564524') self.title.set('Python Programming') self.author.set('Gabriel Gestosani') self.yr_of_pub.set('2019') self.editions.set('3rd') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 13) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('13') self.due.set(days3) Details() elif (val == ' PHP'): self.ID.set('ISBN 735893') self.title.set('PHP Programming') self.author.set('Joken Villanueva') self.yr_of_pub.set('2019') self.editions.set('5th') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 15) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('15') self.due.set(days3) Details() elif (val == ' Java Script'): self.ID.set('ISBN 643842') self.title.set('Java Script Programming') self.author.set('Jude Suarez.') self.yr_of_pub.set('2019') self.editions.set('4th') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 13) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('13') self.due.set(days3) Details() elif (val == ' My SQL'): self.ID.set('ISBN 649635') self.title.set('My SQL Programming') self.author.set('Adones Evangelista') self.yr_of_pub.set('2019') self.editions.set('3rd') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 20) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('20') self.due.set(days3) Details() elif (val == ' Data Structure'): self.ID.set('ISBN 531588') self.title.set('Data Structure') self.author.set('Jennifer Juaniza') self.yr_of_pub.set('2019') self.editions.set('5th') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 11) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('11') self.due.set(days3) Details() elif (val == ' Linux'): self.ID.set('ISBN 356853') self.title.set('Linux Administration') self.author.set('ITSOURCECODE') self.yr_of_pub.set('2019') self.editions.set('1st') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 6) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('6') self.due.set(days3) Details() elif (val == ' Operating System'): self.ID.set('ISBN 536453') self.title.set('OS Concepts ') self.author.set('Marry Ann Goroy') self.yr_of_pub.set('2019') self.editions.set('4th') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 12) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('12') self.due.set(days3) Details() elif (val == ' Web Developement'): self.ID.set('ISBN 543548') self.title.set('Web Developement ') self.author.set('Jhazel Alarcon') self.yr_of_pub.set('2019') self.editions.set('3rd') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 15) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('15') self.due.set(days3) Details() elif (val == ' Data Science'): self.ID.set('ISBN 835764') self.title.set('Data Science Concept ') self.author.set('Ryan Manaay') self.yr_of_pub.set('2019') self.editions.set('3rd') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 15) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('15') self.due.set(days3) Details() elif (val == ' Algorithms'): self.ID.set('ISBN 535674') self.title.set('Basics of Algorithm ') self.author.set('Paul Angelo Niar') self.yr_of_pub.set('2019') self.editions.set('7th') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 10) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('10') self.due.set(days3) Details() elif (val == ' Android'): self.ID.set('ISBN 356452') self.title.set('Android Programming') self.author.set('Jomhel Dulla') self.yr_of_pub.set('2019') self.editions.set('4th') import datetime days1 = datetime.date.today() days2 = datetime.timedelta(days = 9) days3 = (days1 + days2) self.borrow.set(days1) self.loan.set('9') self.due.set(days3) Details() sroll_b_1 = Scrollbar(Library_Frame_2) sroll_b_1.grid(row =0, column = 1, sticky = 'ns') self.List_bx_1 = Listbox(Library_Frame_2, font = ('arial', 13, 'bold'), width = 20, height = 10) self.List_bx_1.bind('<<ListboxSelect>>', SelectedBook) self.List_bx_1.grid(row = 0, column = 0) sroll_b_1.config(command = self.List_bx_1.yview) scroll_b_2 = Scrollbar(Library_Detail_Frame) scroll_b_2.grid(row = 1, column = 1, sticky = 'ns') self.List_bx_2 = Listbox(Library_Detail_Frame, font = ('arial', 13, 'bold'), width = 144, height = 11) self.List_bx_2.bind('<<ListboxSelect>>', BookRec) self.List_bx_2.grid(row = 1, column = 0) scroll_b_2.config(command = self.List_bx_2.yview) for items in List_of_Books: self.List_bx_1.insert(END, items) btnsave_1 = Button(btn_Frame, text = 'SAVE', font = ('arial',15,'bold'), width = 10, command = Insert) btnsave_1.grid(row = 0, column = 0, padx = 8, pady = 5) btndisplay_2 = Button(btn_Frame, text = 'DISPLAY', font = ('arial',15,'bold'), width = 10, command = Display) btndisplay_2.grid(row = 0, column = 1, padx = 8) btnreset_3 = Button(btn_Frame, text = 'RESET', font = ('arial',15,'bold'), width = 10, command = Reset) btnreset_3.grid(row = 0, column = 2, padx = 8) btnupdate_4 = Button(btn_Frame, text = 'UPDATE', font = ('arial',15,'bold'), width = 10, command = Update) btnupdate_4.grid(row = 0, column = 3, padx = 8) btnsearch_5 = Button(btn_Frame, text = 'SEARCH', font = ('arial',15,'bold'), width = 10, command = Search) btnsearch_5.grid(row = 0, column = 4, padx = 8) btndelete_6 = Button(btn_Frame, text = 'DELETE', font = ('arial',15,'bold'), width = 10, command = Delete) btndelete_6.grid(row = 0, column = 5, padx = 8) btnexit_7 = Button(btn_Frame, text = 'EXIT', font = ('arial',15,'bold'), width = 10, command = Exit) btnexit_7.grid(row = 0, column = 6, padx = 8) if __name__ == '__main__': root = Tk() applicaton = Library(root) root.mainloop() |
This module is for the marksheet
In the code given below, which is for the function of marksheet. In the marksheet you can search and create new. It is also include the design of marksheet.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 |
from tkinter import * import random import College_Marksheet_Backend import tkinter.messagebox from tkinter import ttk def marking_sheet(): root = Tk() root.title('Marksheet') root.geometry('1350x750') root.config(bg = 'Navajo white') name = StringVar() roll = StringVar() father_name = StringVar() mother_name = StringVar() date_of_birth = StringVar() gender = StringVar() school = StringVar() email_address = StringVar() marks1 = DoubleVar() marks2 = DoubleVar() marks3 = DoubleVar() marks4 = DoubleVar() marks5 = DoubleVar() grand_tot = DoubleVar() percentage = DoubleVar() cgpa = DoubleVar() grade = StringVar() division = StringVar() result = StringVar() def Add(): if (len(roll.get()) != 0): College_Marksheet_Backend.insert(name.get(), roll.get(), father_name.get(), mother_name.get(), date_of_birth.get(), gender.get(), \ school.get(), email_address.get(), marks1.get(), marks2.get(), marks3.get(), marks4.get(), marks5.get(), \ grand_tot.get(), percentage.get(), cgpa.get(), grade.get(), division.get(), result.get()) def Update(): if (len(roll.get()) != 0): College_Marksheet_Backend.update(name.get(), roll.get(), father_name.get(), mother_name.get(), date_of_birth.get(), gender.get(), \ school.get(), email_address.get(), marks1.get(), marks2.get(), marks3.get(), marks4.get(), marks5.get(), \ grand_tot.get(), percentage.get(), cgpa.get(), grade.get(), division.get(), result.get()) def Exit(): Exit = tkinter.messagebox.askyesno('Marksheet','Confirm if you want to Exit') if Exit > 0: root.destroy() return def Compute(): num1 = (marks1.get()); num2 = (marks2.get()); num3 = (marks3.get()); num4 = (marks4.get()); num5 = (marks5.get()) if num1 > 100: tkinter.messagebox.askokcancel('Attention','Please enter Correct Marks') return if num2 > 100: tkinter.messagebox.askokcancel('Attention','Please enter Correct Marks') return if num3 > 100: tkinter.messagebox.askokcancel('Attention','Please enter Correct Marks') return if num4 > 100: tkinter.messagebox.askokcancel('Attention','Please enter Correct Marks') return if num5 > 100: tkinter.messagebox.askokcancel('Attention','Please enter Correct Marks') return TOTAL = num1+num2+num3+num4+num5 grand_tot.set(TOTAL) Percentage = ((num1 + num2 + num3 + num4 + num5) * 100) / 500 percentage.set(Percentage) c_grades = (((num1+num2+num3+num4+num5) * 100)/500) / 9.5 cgpa.set(round(c_grades,1)) if c_grades > 10: cgpa.set(10) if (((num1+num2+num3+num4+num5) * 100)/500) <= 40: grades = 'G' elif (((num1+num2+num3+num4+num5) * 100)/500) <= 50: grades = 'F' elif (((num1+num2+num3+num4+num5) * 100)/500) <= 60: grades = 'E' elif (((num1+num2+num3+num4+num5) * 100)/500) <= 70: grades = 'D' elif (((num1+num2+num3+num4+num5) * 100)/500) <= 80: grades = 'C' elif (((num1+num2+num3+num4+num5) * 100)/500) <= 90: grades = 'B' else: grades = 'A' grade.set(grades) count = 0 if num1 < 33: count = count + 1 if num2 < 33: count = count + 1 if num3 < 33: count = count + 1 if num4 < 33: count = count + 1 if num5 < 33: count = count + 1 if (count == 0): result.set('PASS') elif (count == 1 or count == 2 ): result.set('SUPPLY') else: result.set('FAIL') if Percentage <= 45 and result != "FAIL": division.set('THIRD') elif Percentage <= 60 and result != "FAIL": division.set('SECOND') elif Percentage <= 100: division.set('FIRST') def Reset(): name.set(' ') roll.set(' ') father_name.set(' ') mother_name.set(' ') date_of_birth.set(' ') gender.set(' ') school.set(' ') email_address.set(' ') marks1.set(' ') marks2.set(' ') marks3.set(' ') marks4.set(' ') marks5.set(' ') grand_tot.set(' ') percentage.set(' ') cgpa.set(' ') grade.set(' ') division.set(' ') result.set(' ') #========================================================Marks_Frame_1=============================================================== Marks_Frame_1 = LabelFrame(root, width = 1200, height = 400, font = ('arial',20,'bold'), bg = 'Navajo white', bd = 10, \ text = 'Student Details', relief = 'ridge') Marks_Frame_1.grid(row = 1, column = 0, pady = 20, padx = 20) Name_lbl = Label(Marks_Frame_1, text = 'Name', font = ('arial',15,'bold'), bg = 'Navajo white') Name_lbl.grid(row = 0, column = 0, padx = 80) Name_TxtEntry = Entry(Marks_Frame_1, font = ('arial',15), width = 25, textvariable = name) Name_TxtEntry.grid(row = 0, column = 1, padx = 5, pady = 5) RollNumber_lbl = Label(Marks_Frame_1, text = 'Roll Number', font = ('arial',15,'bold'), bg = 'Navajo white') RollNumber_lbl.grid(row = 0, column = 3, padx = 80) RollNumber_TxtEntry = Entry(Marks_Frame_1, font = ('arial',15), width = 25, textvariable = roll) RollNumber_TxtEntry.grid(row = 0, column = 4, padx = 40) fname_lbl = Label(Marks_Frame_1, text = 'Father Name', font = ('arial',15,'bold'), bg = 'Navajo white') fname_lbl.grid(row = 1, column = 0, padx = 80) fname_txtEntry = Entry(Marks_Frame_1, font = ('arial',15), width = 25, textvariable = father_name) fname_txtEntry.grid(row = 1, column = 1, padx = 5, pady = 10) mname_lbl = Label(Marks_Frame_1, text = 'Mother Name', font = ('arial',15,'bold'), bg = 'Navajo white') mname_lbl.grid(row = 1, column = 3, padx = 80) mname_txtEntry = Entry(Marks_Frame_1, font = ('arial',15), width = 25, textvariable = mother_name) mname_txtEntry.grid(row = 1, column = 4, padx = 5) dateOFbirth_lbl = Label(Marks_Frame_1, text = 'Date of Birth', font = ('arial',15,'bold'), bg = 'Navajo white') dateOFbirth_lbl.grid(row = 2, column = 0, padx = 80) dateOFbirth_txtEntry = Entry(Marks_Frame_1, font = ('arial',15), width = 25, textvariable = date_of_birth) dateOFbirth_txtEntry.grid(row = 2, column = 1, padx = 5, pady = 5) gender_lbl = Label(Marks_Frame_1, text = 'Gender', font = ('arial',15,'bold'), bg = 'Navajo white') gender_lbl.grid(row = 2, column = 3, padx = 80) gender_txtEntry = ttk.Combobox(Marks_Frame_1, values = (' ','Male','Female','Others'), font = ('arial',15), width = 23, textvariable = gender) gender_txtEntry.grid(row = 2, column = 4, padx = 5, pady = 5) school_lbl = Label(Marks_Frame_1, text = 'School Name', font = ('arial',15,'bold'), bg = 'Navajo white') school_lbl.grid(row = 3, column = 0, padx = 80) school_txtEntry = Entry(Marks_Frame_1, font = ('arial',15), width = 25, textvariable = school) school_txtEntry.grid(row = 3, column = 1, padx = 5, pady = 5) emailAddress_lbl = Label(Marks_Frame_1, text = 'Email ID', font = ('arial',15,'bold'), bg = 'Navajo white') emailAddress_lbl.grid(row = 3, column = 3, padx = 80) emailAddress_txtEntry = Entry(Marks_Frame_1, font = ('arial',15), width = 25, textvariable = email_address) emailAddress_txtEntry.grid(row = 3, column = 4, padx = 5, pady = 5) Marks_Frame_2 = LabelFrame(root, width = 1200, height = 400, font = ('arial',20,'bold'), bg = 'Navajo white', bd = 10 \ , text = 'Grades Point Obtained', relief = 'ridge') Marks_Frame_2.grid(row = 3, column = 0) subject_lbl = Label(Marks_Frame_2, text = 'SUBJECT', font = ('arial',16,'bold'), bg = 'Navajo white') subject_lbl.grid(row = 3, column = 0, padx = 50, pady = 10) marks_obtained_lbl = Label(Marks_Frame_2, text = 'MARKS OBTAINED', font = ('arial',16,'bold'), bg = 'Navajo white') marks_obtained_lbl.grid(row = 3, column = 1, padx = 20) subject_lbl = Label(Marks_Frame_2, text = 'PASSING MARKS', font = ('arial',16,'bold'), bg = 'Navajo white') subject_lbl.grid(row = 3, column = 2, padx = 20) marks_obtained_lbl = Label(Marks_Frame_2, text = 'TOTAL MARKS', font = ('arial',16,'bold'), bg = 'Navajo white') marks_obtained_lbl.grid(row = 3, column = 3, padx = 20) MATHEMATICS_lbl1 = Label(Marks_Frame_2, text = 'MATHEMATICS', font = ('arial',14), bg = 'Navajo white') MATHEMATICS_lbl1.grid(row = 4, column = 0) PHYSICS_lbl2 = Label(Marks_Frame_2, text = 'PHYSICS', font = ('arial',14), bg = 'Navajo white') PHYSICS_lbl2.grid(row = 5, column = 0) CHEMISTRY_lbl3 = Label(Marks_Frame_2, text = 'CHEMISTRY', font = ('arial',14), bg = 'Navajo white') CHEMISTRY_lbl3.grid(row = 6, column = 0) PROGRAMMING_lbl4 = Label(Marks_Frame_2, text = 'PROGRAMMING', font = ('arial',14), bg = 'Navajo white') PROGRAMMING_lbl4.grid(row = 7, column = 0) ENGLISH_lbl5 = Label(Marks_Frame_2, text = 'ENGLISH', font = ('arial',14), bg = 'Navajo white') ENGLISH_lbl5.grid(row = 8, column = 0) GRAND_TOTAL_lbl6 = Label(Marks_Frame_2, text = 'GRAND TOTAL', font = ('arial',16), bg = 'Navajo white') GRAND_TOTAL_lbl6.grid(row = 9, column = 0) PERCENTAGE_lbl7 = Label(Marks_Frame_2, text = 'PERCENTAGE', font = ('arial',16,'bold'), bg = 'Navajo white') PERCENTAGE_lbl7.grid(row = 10, column = 0) CGPA_lbl8 = Label(Marks_Frame_2, text = 'CGPA', font = ('arial',16,'bold'), bg = 'Navajo white') CGPA_lbl8.grid(row = 10, column = 2) GRADE_lbl9 = Label(Marks_Frame_2, text = 'GRADE', font = ('arial',16,'bold'), bg = 'Navajo white') GRADE_lbl9.grid(row = 10, column = 4) DIVISION_lbl10 = Label(Marks_Frame_2, text = 'DIVISION', font = ('arial',16,'bold'), bg = 'Navajo white') DIVISION_lbl10.grid(row = 11, column = 0) DIVISION_lbl10 = Label(Marks_Frame_2, text = 'RESULT', font = ('arial',16,'bold'), bg = 'Navajo white') DIVISION_lbl10.grid(row = 11, column = 2) variables_1 = StringVar(Marks_Frame_2, value = '33') variables_2 = StringVar(Marks_Frame_2, value = '100') variables_3 = StringVar(Marks_Frame_2, value = '500') Text_Entry1 = Entry(Marks_Frame_2, font = ('arial',16), width = 5, textvariable = marks1) Text_Entry1.grid(row = 4, column = 1) Text_Entry2 = Entry(Marks_Frame_2, font = ('arial',16), width = 5, textvariable = marks2) Text_Entry2.grid(row = 5, column = 1) Text_Entry3 = Entry(Marks_Frame_2, font = ('arial',16), width = 5, textvariable = marks3) Text_Entry3.grid(row = 6, column = 1) Text_Entry4 = Entry(Marks_Frame_2, font = ('arial',16), width = 5, textvariable = marks4) Text_Entry4.grid(row = 7, column = 1) Text_Entry5 = Entry(Marks_Frame_2, font = ('arial',16), width = 5, textvariable = marks5) Text_Entry5.grid(row = 8, column = 1) Text_Entry6 = Entry(Marks_Frame_2, font = ('arial',14), width = 5, textvariable = grand_tot, state = 'readonly') Text_Entry6.grid(row = 9, column = 1, pady = 8) Text_Entry7 = Entry(Marks_Frame_2, font = ('arial',14,'bold'), width = 5, textvariable = percentage, state = 'readonly') Text_Entry7.grid(row = 10, column = 1, pady = 8) Text_Entry8 = Entry(Marks_Frame_2, font = ('arial', |