-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibrary_system2.py
More file actions
67 lines (47 loc) · 1.69 KB
/
Copy pathlibrary_system2.py
File metadata and controls
67 lines (47 loc) · 1.69 KB
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
from library_system1 import *
#db = MySQLdb.connect("localhost","root","1CLOUD","Librarysystem_project" )
#cursor = db.cursor()
print "//**********************************//"
print " LIBRARY MANGAGEMENT SYSTEM "
print "//**********************************//"
s1 = student()
b1 = book()
while True:
print "\n1.Admin\n2.Student\n3.Exit"
n=raw_input("Enter your choice:")
if n == '1':
print "ADMIN MENU"
admin = raw_input("enter username:")
password = raw_input("\nenter password:")
if admin!='Admin' or password!='Admin':
print "Unauthorised Access!"
exit()
else:
while True:
print "\nAdmin Particulars\n1.Display Student list\n2.View Book Details\n3.Delete Student Record\n4.Add Books\n5.Exit\n"
m=raw_input("enter your choice:")
if m == '1':
s1.Display_studentlist()
numrows = int (cursor.rowcount)
for x in range(0, numrows):
row = cursor.fetchone()
print row[0],"-->",row [1],"-->",row[2],"-->",row[3]
elif m =='2':
b1.Display_Books()
numrows = int (cursor.rowcount)
for x in range(0, numrows):
row = cursor.fetchone()
print row[0],"-->",row [1],"-->",row[2]
elif m =='3':
j = input('enter usn of student to be removed:')
elif m =='4':
b1.create_book()
else:
break
elif n =='2':
print "***Student MENU***"
s1.Student_details()
s1.add_student()
else:
db.close()
exit()