forked from DeepNinja07x/Python_Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI form.py
40 lines (30 loc) · 1.07 KB
/
GUI form.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from tkinter import *
def submit():
getf=first.get()
getl=last.get()
geta=age.get()
file=open('database.txt','a')
file .write(getf+",",+getl+","+str(geta)+"\n")
file.close()
print("user registered")
entry_first.delete(0,END)
entry_last.delete(0,END)
entry_age.delete(0,END)
window=Tk()
window.title("Registration Form")
window.geometry("350x350")
l1=Label(window, text="Please Register Now", bg="black", fg="white", font="times 12")
l1.pack()
first=StringVar()
last=StringVar()
age=IntVar()
Label(window, text="First Name: ",bg="black", fg="white").place(x=50,y=60)
entry_first=Entry(window,textvariable=first)
entry_first.place(x=150,y=60)
Label(window, text="Last Name: ",bg="black", fg="white").place(x=50,y=100)
entry_last=Entry(window, textvariable=last)
entry_last.place(x=150,y=120)
Label(window, text="Age: ",bg="black", fg="white").place(x=50,y=1800)
entry_age=Entry(window, textvariable=age)
entry_age.place(x=150,y=1800)
Button(window, text="Submit", bg="black", fg="white", font="times 12", command=submit).place(x=100,y=240)