Advertisement
Guest User

Untitled

a guest
Jan 2nd, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. import tkinter
  2. from tkinter import messagebox
  3. window = tkinter.Tk()
  4. window.title('Sign-in Page')
  5. window.iconbitmap('C:\Users\neel-_000DownloadsIconshock-Cms-User-login.ico')
  6. window.geometry("1200x1200")
  7. window.configure(background='#0B4C5F')
  8. labelfont = ('times', 20, 'bold')
  9. user_info = []
  10. def callback():
  11. username_2 = username_0.get()
  12. if not username_2.isalpha() or len(username_2) < 1:
  13. username = tkinter.Label(text=" Invalid Username", font=('Times New Roman', 12), anchor='center').pack()
  14. error_message = tkinter.Label(text=" Please Restart Program to Retry").pack()
  15. import time
  16. time.sleep(0.5)
  17. print("Username not accepted")
  18. not_accepted = tkinter.Label(text='Username has not been accepted, close program and retry')
  19.  
  20. else:
  21. label = tkinter.Label(text= 'Welcome ' + username_2 + ' ! It is good to see you')
  22. label.pack()
  23. user_info.append(username_2)
  24. print("username excepted")
  25.  
  26.  
  27. password_ref = password_0.get()
  28. if len(password_ref) < 1:
  29. username = tkinter.Label(text=" Invalid Password", font=('Times New Roman', 12), anchor='center').pack()
  30. error_message = tkinter.Label(text=" Please Restart Program to Retry").pack()
  31. import time
  32. time.sleep(0.5)
  33. print("Password not accepted")
  34. pass_not_accepted = tkinter.Label(text='Password has not been accepted, close program and retry')
  35.  
  36.  
  37. else:
  38. user_info.append(password_ref)
  39. print("password excepted")
  40.  
  41. return callback
  42.  
  43. username = tkinter.Label(text="Username", font=('Times New Roman', 12), height=1, width=15)
  44. username_0 = tkinter.Entry(window, font=("Times",14))
  45. username.pack()
  46. username.place(x=535, y=271)
  47. username_0.pack()
  48. username_0.place(x=510, y=310, height=25, width=200)
  49. password = tkinter.Label(text='Password', font=('Times New Roman', 12), height=1, width=15)
  50. password_0 = tkinter.Entry(window, show='*', font=('Times', 14))
  51. password.pack()
  52. password.place(x=535, y=360)
  53. password_0.pack()
  54. password_0.place(x = 510, y = 400, height=25, width=200)
  55. button = tkinter.Button(text="Sign In", fg='#0B4C5F', bg='White', command=callback, activebackground="Black",
  56. activeforeground= "white", cursor="circle")
  57. button.flash()
  58. button.pack()
  59. button.place(x=530, y = 450, height=45, width=150)
  60. keep_sign_in = tkinter.Checkbutton(window,text="Keep me logged in")
  61. keep_sign_in.pack()
  62. keep_sign_in.place(x=510, y=500, height=50, width=200)
  63.  
  64. window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement