0% found this document useful (0 votes)
19 views

Python Pro Ques

Uploaded by

nitinolxuser
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Python Pro Ques

Uploaded by

nitinolxuser
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

ABC School library offers reading services and membership to the students on roll.

The students
are issued a library ticket for getting the books issued and library fee is included in the fees. There
is also a provision for teachers to get the books issued as per their requirement. Library Members
can avail of the following facilities: 1. Providing books/journals for reading/reference. 2. Issue of
books to students so that they can take them home and return them on or before the due date.
When a new book is brought to the library, its record is created, which can be modified or deleted
if the book is no longer available in the library. If a student requests for a book, it is first searched
for its availability through a unique key field “Bno”, i.e., Book code. If it is available (i.e., not issued
to any other member) then it is issued and details are entered in the Issue module. The books are
issued for 10 days after which they are required to be returned on or before the due date. The
details of the same are entered in the Issue module. A new member can be added, his record can
be modified, and an existing member can be removed from the library membership, for which
necessary changes are made in the Member module. The project (Front-end) has been developed
using Python version 3.7.1. The RDBMS (Relational Database Management System) used is MySQL.
Thus, the entire project is based on PythonMySQL connectivity. The important modules used in
our project are listed below:  MENULIB  LIBRARY MANAGEMENT  BOOK  ISSUE  MEMBER
The three MySQL tables used for storing the book details, member details and issue details in this
project are:  bookRecord  issue  member Name of the Database: Library About Python-MySQL
Connectivity While designing real-life applications, certain situations arise pertaining to storing
some important and necessary information by the user. Usually, the data inputted by the user
along with the generated output are displayed but are not stored, since all the program execution
takes place inside the RAM, which is a temporary memory, and as soon as we close the form, its
contents (form input and generated output) get erased. They can’t be retrieved since they are not
getting saved on a hard disk (or any secondary storage device). Thus, when the application is
executed for the second time, it requires a new set of inputs from the user. This limitation can be
overcome by sending the output generated and saving the input fetched from the user in a
database created at the back-end of the application. The input is fetched from the user using
Python Interface. This is termed as the Front End Interface of the application. MySQL Python Fig.:
Front-end (Python) and Back-end (MySQL) Database (The Back-end) While working with an
application, it is required to save data permanently on some secondary storage device, which is
usually the hard disk, so that the data can be retrieved for future reference, modification, deletion,
etc. An application usually stores a lot of data in the form of a database which is not directly
accessible to the user. This database is used by the application to give suitable responses to the
user. This database is called Back-end Database. In Class XI, we have learnt how to create
databases, tables and to perform query processing on these tables using SQL commands like
CREATE, UPDATE, ALTER, INSERT, DELETE, SELECT and so on in various forms according to their
specific syntax structures. We shall be implementing all these DDL and DML commands of SQL
through Python Interface. Why Python? Python is a flexible, portable, easy to learn and modifiable
language. So, we are integrating MySQL with Python Interface for executing any database
applications. The various reasons to use Python for programming database applications are: •
Programming in Python is arguably more efficient and faster compared to other languages. •
Python is famous for its portability. • It is platform-independent. • Python supports SQL cursors. •
In many programming languages, the application developer needs to take care of the open and
closed connections of the database, to avoid further exceptions and errors. In Python, these
connections are taken care of. • Python supports relational database systems. • Python database
APIs are compatible with various databases, so it is very easy to migrate and port database
application interfaces. Coding #Project on Library Management System
#-------------------------------------------------------------------- #MODULE : LIBRARY MANAGEMENT import
MenuLib import Book import issue while True: Book.clrscreen() print("\t\t\t Library Management\
n") print("=========================================================") print("1. Book
Management") print("2. Members Management") print("3. Issue/Return Book") print("4. Exit")
print("=========================================================")
choice=int(input("Enter Choice between 1 to 4-------> : ")) if choice==1: MenuLib.MenuBook() elif
choice==2: MenuLib.MenuMember() elif choice==3: MenuLib.MenuIssueReturn() elif choice==4:
break else: print("Wrong Choice......Enter Your Choice again") x=input("Enter any key to continue")
#PYTHON MODULE: MENULIB import Book import Member import issue def MenuBook(): while
True: Book.clrscreen() print("\t\t\t Book Record Management\n")
print("======================================================") print("1. Add Book
Record") print("2. Display Book Records") print("3. Search Book Record") print("4. Delete Book
Record") print("5. Update Book Record") print("6. Return to Main Menu")
print("======================================================") choice=int(input("Enter
Choice between 1 to 5-------> : ")) if choice==1: Book.insertData() elif choice==2: Book.display() elif
choice==3: Book.SearchBookRec() elif choice==4: Book.deleteBook() elif choice==5: print("No such
Function") elif choice==6: return else: print("Wrong Choice......Enter Your Choice again")
x=input("Enter any key to continue")

You might also like