-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass8.py
More file actions
29 lines (26 loc) · 1.02 KB
/
Class8.py
File metadata and controls
29 lines (26 loc) · 1.02 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
26
27
28
29
import tkinter
window = tkinter.Tk()
window.title("Hello World")
def signin():
tkinter.Label(window, text = "You are being signed in!").grid(row=4)
file.write(user.get())
file.write("\n"+str(password.get()))
file.close()
file = open("Userinfo.txt","w")
'''
label = tkinter.Label(window,text = "Welcome to my first TKinter program").pack()
button = tkinter.Button(window,text = "Click on me!")
button.pack()
btn1 = tkinter.Button(window,text="Red",fg="red",bg="black").pack()
chk1 = tkinter.Checkbutton(window, text = "green", fg="green").pack()
chk2 = tkinter.Checkbutton(window, text = "blue",fg="blue").pack()
'''
tkinter.Label(window, text="Username").grid(row = 0)
user = tkinter.Entry(window)
user.grid(row = 0, column = 1)
tkinter.Label(window, text="Password").grid(row = 1)
password = tkinter.Entry(window, show="*")
password.grid(row=1,column=1)
tkinter.Checkbutton(window, text = "Keep me logged in").grid(columnspan = 2)
tkinter.Button(window,text = "Sign in", command=signin).grid(columnspan = 2)
window.mainloop()