From 4e751c9f1d282b759fb0c16547b963d0b1a2d2a1 Mon Sep 17 00:00:00 2001 From: Ritabhas <132703149+Ritabhas@users.noreply.github.com> Date: Sat, 28 Oct 2023 21:37:47 +0530 Subject: [PATCH] Create UsernInterface.py --- Python Projects/UsernInterface.py | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Python Projects/UsernInterface.py diff --git a/Python Projects/UsernInterface.py b/Python Projects/UsernInterface.py new file mode 100644 index 00000000..1a4a3084 --- /dev/null +++ b/Python Projects/UsernInterface.py @@ -0,0 +1,40 @@ +from tkinter import * +import mysql.connector as S +conn=S.connect(host="localhost",user="root",passwd="chikuSQL@123",database="chiku") #Information to be entered by user. +cursor=conn.cursor() +root=Tk() +root.geometry("500x300") +root.title("VVV Project") + +#Storing Data from File onto Database +def storevals(a,b,c,d): + sql1='''CREATE TABLE Std_Info( + Name varchar(20), + Class varchar(6), + Section varchar(2), + Roll_Number varchar(2) primary key, + Gender varchar(6) + )''' + cursor.execute(sql1) + sql="INSERT INTO Std_Info(Name,Class,Section,Roll_Number,Gender) VALUES(%s,%s,%s,%s,%s)" + vals=(a,b,c,d,"U") + cursor.execute(sql,vals) + conn.commit() + print("data saved") + conn.close() + +#Trigger Function Storing Values in a Binary File +def getvals(): + print("Accepted") + d={} + a=nameentry.get() + b=stdentry.get() + c=sectionentry.get() + d=rollentry.get() + storevals(a,b,c,d) + print("Data Stored") + print(a) + +#Heading +Label(root, text="Sign Up Portal", font="calibri 20 bold").grid(row=0,column=3) +