Advertisement
Guest User

Untitled

a guest
Nov 12th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. from tkinter import *# Ingress all components from Tkinter
  2. import tkinter.messagebox as box
  3.  
  4. def condition():
  5. while condition == (username == 'admin' and password == 'ad121'):
  6. print = label(text('Welcome back admin user!',bg='Light Blue',font='none 14 bold').place(x=0,y=160))
  7.  
  8. def dialog1():
  9.  
  10. username=entry1.get()
  11. password = entry2.get()
  12. if (username == 'admin' and password == 'admin1'):#Correct log in details
  13.  
  14. box.showinfo('info','Access granted')# correct response
  15. else:
  16. box.showinfo('info','Invalid Login')# decline response
  17.  
  18. window = Tk()
  19. window.geometry('400x400')# The size of the form window
  20. window.title('Office login system')#title of the form
  21.  
  22. frame = Frame(window)
  23.  
  24. mlabel = Label(text='Log in system', bg='Light Blue',font='none 18 bold underline')# The colours and font style and size used for the form title
  25. mlabel.pack()
  26.  
  27. Label1 = Label(window,text = 'Username:',bg='Light Blue',font='none 14 bold').place(x=0,y=100)# The colours and font style and size used for the entry box
  28. entry1 = Entry(window).place(x=140,y=108)#Size and colour of the text box
  29.  
  30.  
  31. entry1 = Entry(window,bd =5).pack(padx=15, pady=5)
  32.  
  33.  
  34. Label2 = Label(window,text = 'Password:',bg='Light Blue',font='none 14 bold').place(x=0,y=150)# The colours and font style and size used for the entry box
  35. entry2 = Entry(window).place(x=140,y=155)#Size and colour of the text box
  36.  
  37.  
  38. entry2 = Entry(window, bd=5,).pack(padx = 15,pady=7)
  39.  
  40.  
  41.  
  42. window.configure(background='Orange')
  43.  
  44. btn = Button(window, text = 'Check Login',bg='Light Blue',font='none 14 bold',command = dialog1)
  45.  
  46.  
  47. btn.place(x=130,y=250)
  48. frame.pack(padx =200,pady =190)
  49.  
  50.  
  51. window.mainloop()# The code iterates
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement