python
Dashboard
My Repos
Compilers
Python Online
Node JS Online
Golang Online
codepy
Login
My Repos
Sign Out
Online Python Interpreter
Stop
Run
#student management system #1.admin login-student details,fee details,identity card maker,admission form,roll no genera import numpy as np import pandas as pd import mysql.connector as sqltor import pymysql from sqlalchemy import create_engine print("admin login") username=input("enter username:") password=input("enter password:") if(username=="tanushri" and password=="tanu"): while(1): print("login successful") print("-----student management system-----") print("1.storing details and making changes") print("2.fee details") print("3.id card generator") ch=int(input("enter your choice:")) if (ch==1): print("1.add") print("2.view") print("3.update") print("4.delete") print("5.search") print("6.exit") ch=int(input("enter your choice:")) if(ch==1): n=int(input("enter number of students:")) a1=[] b1=[] c1=[] d1=[] d1=[] e1=[] f1=[] g1=[] for i in range(n): a=input("enter name:") a1.append(a) b=input("enter class and section:") b1.append(b) c=input("enter stream:") c1.append(c) d=input("enter date of birth:") d1.append(d) e=input("enter address:") e1.append(e) f=input("enter guardian's name:") f1.append(f) g=int(input("enter phone number:")) g1.append(g) stu={"name":a1,"classandsection":b1,"stream":c1,"dob":d1,"address":e1,"guardian's name":f1,"phoneno":g1} df1=pd.DataFrame(stu) engine=create_engine('mysql+pymysql://root:jss@localhost/student') conn=engine.connect() df1.to_sql("student",conn,if_exists='append') elif(ch==2): print("-----student details-----") mycon=sqltor.connect(host="localhost",user="root",passwd="jss",database="student") if mycon.is_connected(): print("successfully connected to mysql database") df=pd.read_sql("select * from student;",mycon) print(df) elif(ch==3): mycon=sqltor.connect(host="localhost",user="root",passwd="jss",database="student") if mycon.is_connected(): print("successfully connected to mysql database") df=pd.read_sql("select * from student;",mycon) print(df) column=input("enter the name of the column to be updated:") row=int(input("enter the index of the row to be updated:") value=input("enter new value:") df1=df.columns['row'] print("the modified row is:") print(df1)
Share this code with others
Public
Clear
My Repos
Repo
Lang
Login
Register
Login
Create a free account. No Credit card info required.
I agree with the Codepy
Term of Service
Sign Up