Python Project1-Student Management
Python Project1-Student Management
import pymysql
import os
exit='n'
while exit=='n':
os.system('cls')
print('-' * 90)
print('|'+' '*31+'STUDENT MANAGEMENT SYSTEM'+' ' * 32+ '|')
print('-' * 90)
print('| [I]nsert Record |', end='')
print(' [V]iew Record |', end='')
print(' [U]pdate Record |',end='')
print(' [D]elete Record |',end='')
print(' [E]XIT |')
print('-' * 90)
ch=input('YOUR Choice (I/V/U/D/E):')
ch = ch.upper()
if ch == 'I':
connection=pymysql.connect(host="localhost", user="root"
, passwd="root", db="school")
mycursor=connection.cursor()
choice='y'
while choice=='y':
www.anjeevsinghacademy.com
Python Project – Student Management System
elif ch == 'V':
connection=pymysql.connect(host="localhost", user="root"
, passwd="root", db="school")
mycursor=connection.cursor()
#mycursor.execute("""create table class12 (rno int, name
varchar(20))""")
choice='y'
while choice=='y':
count=0
for(rno,name)in mycursor:
count+=1
print('===========')
print('Student Roll No ',rno)
print('Student Name ',name)
print('===========')
if count%2==0:
print('press any key to continue')
clrscreen()
print('total records',count,'found')
connection.commit()
connection.close()
www.anjeevsinghacademy.com
Python Project – Student Management System
elif ch == 'U':
connection=pymysql.connect(host="localhost", user="root"
, passwd="root", db="school")
mycursor=connection.cursor()
#mycursor.execute("""create table class12 (rno int, name
varchar(20))""")
choice='y'
while(choice=='y'):
connection=pymysql.connect(host="localhost", user="root"
, passwd="root", db="school")
mycursor=connection.cursor()
#mycursor.execute("""create table class12 (rno int, name
varchar(20))""")
choice='y'
while choice=='y':
www.anjeevsinghacademy.com
Python Project – Student Management System
rno=int(input('enter the roll number of student whos
e record you want to delete '))
www.anjeevsinghacademy.com