Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- #Login GUI
- window = Tk()
- window.title("Countries Generation")
- window.geometry("400x300")
- window.configure(bg="#cccccc")
- username = "admin"
- password = "secret"
- def callback():
- if (usertitle == username) and (passtitle == password):
- message.configure(text = "Valid Logged in.")
- else:
- message.configure(text = "Username and password don't match. \nPlease try again.")
- title1 = Label(window, text="Log in", bg="#6491ca")
- usertitle = Label(window, text="---Username---", bg="#6491ca")
- passtitle = Label(window, text="---Password---", bg="#6491ca")
- message = Label(window, bg="#6491ca")
- user = Entry(window)
- passw = Entry(window, show='*')
- go = Button(window, text="Log in!", command = callback, bg="#3e3365")
- title1.pack()
- usertitle.pack()
- user.pack()
- passtitle.pack()
- passw.pack()
- go.pack()
- message.pack()
- window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement