Advertisement
Guest User

Untitled

a guest
Mar 4th, 2017
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.84 KB | None | 0 0
  1. from tkinter import*
  2. from test import *
  3. bgclr="#282828"
  4. fgclr="#cecece"
  5. clr='#004a95'
  6.  
  7. users=[("ss","ss")] #<<<here ''dilip'' is user and ''python'' is password
  8.  
  9. def login():
  10.  
  11.     if(user_Entry.get(),password_Entry.get())in users:
  12.         w.destroy()
  13.  
  14.     else:
  15.         warn.config(text="Invalid username or Password",fg="red")
  16. w=Tk()
  17. w.title("login")
  18. w.geometry("500x300")
  19. w.config(bg=bgclr)
  20. w.resizable()
  21.  
  22. user=Label(w,
  23.            text="User",
  24.            font=("blod",15),
  25.            bg=bgclr,
  26.            fg=fgclr)
  27. user.place(x=20,y=40)
  28.  
  29. user_Entry=Entry(w,bg=bgclr,
  30.                  fg="white",
  31.                  relief=GROOVE,
  32.                  highlightcolor="white",
  33.                  highlightthickness=2,
  34.                  highlightbackground=clr,
  35.                  width=40,
  36.                  font=10,
  37.                  bd=5)
  38. user_Entry.place(x=20,y=80)
  39.  
  40. password=Label(w,
  41.                text="Password",
  42.                font=("blod",15),
  43.                bg=bgclr,
  44.                fg=fgclr)
  45. password.place(x=20,y=120)
  46.  
  47. password_Entry=Entry(w,bg=bgclr,
  48.                      fg="white",
  49.                      relief=GROOVE,
  50.                      highlightcolor="white",
  51.                      highlightthickness=2,
  52.                      highlightbackground=clr,
  53.                      width=40,
  54.                      font=10,
  55.                      show="*",
  56.                      bd=5)
  57. password_Entry.place(x=20,y=160)
  58.  
  59. warn=Label(w,
  60.            font=("blod",10),
  61.            bg=bgclr)
  62.  
  63. warn.place(x=80,y=200)
  64.  
  65.  
  66. button=Button(w,
  67.               text="Login",
  68.               bg=clr,
  69.               fg="white",
  70.               relief=GROOVE,
  71.               highlightcolor=clr,
  72.               highlightthickness=4,
  73.               width=40,
  74.               font=10,
  75.               command=login)
  76. button.place(x=20,y=240)
  77.  
  78. w.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement