Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create UsernInterface.py #422

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Python Projects/UsernInterface.py
Original file line number Diff line number Diff line change
@@ -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)