-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint.py
More file actions
26 lines (25 loc) · 1.26 KB
/
Copy pathprint.py
File metadata and controls
26 lines (25 loc) · 1.26 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
import mysql.connector as sql
from tabulate import tabulate as tub
mycon=sql.connect(host='localhost',user='root',passwd='7654321',database='kvsfee')
cursor=mycon.cursor()
cursor.execute('select unque_id,student_name,gender,sgsc,admission_no,dob,class,stream,fathers_name,mothers_name from class_1;')
data=cursor.fetchall()
for i in data:
print(i)
print(tub(data,headers=['UNQUE_ID','STUDENT NAME','GENDER','SGSC','ADMISSION NO','DOB','CLASS','STREAM','FATHERS NAME','MOTHERS NAME'],tablefmt='psql'))
import mysql.connector as sql
from tabulate import tabulate as tub
mycon=sql.connect(host='localhost',user='root',passwd='7654321',database='kvsfee')
cursor=mycon.cursor()
cursor.execute('select unque_id,student_name,fee_status from class_1;')
data=cursor.fetchall()
for i in data:
print(tub(data,headers=['UNQUE_ID','STUDENT NAME','FEE_STATUS'],tablefmt='psql'))
import mysql.connector as sql
from tabulate import tabulate as tub
mycon=sql.connect(host='localhost',user='root',passwd='7654321',database='kvsfee')
cursor=mycon.cursor()
cursor.execute("select unque_id,student_name,fee_status from class_1 WHERE FEE_STATUS = '{}'".format('PENDING'))
data=cursor.fetchall()
for i in data:
print(tub(data,headers=['UNQUE_ID','STUDENT NAME','FEE_STATUS'],tablefmt='psql'))