Shcoder001

login_tk

Feb 16th, 2023
720
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.16 KB | None | 0 0
  1. import ttkbootstrap
  2.  
  3. window = ttkbootstrap.Window(themename='darkly')
  4. window.title('Авторазиция')
  5. window.geometry('500x500+500+200')
  6.  
  7.  
  8. def login():
  9.     data_login = entry_login.get()
  10.     data_password = entry_password.get()
  11.     if data_login == 'admin' and data_password == 'admin':
  12.         ttkbootstrap.dialogs.dialogs.Messagebox.ok('login good', 'u have entered')
  13.  
  14.  
  15. def showpass():
  16.     if entry_password['show'] == '*':
  17.         entry_password['show'] = ''
  18.     else:
  19.         entry_password['show'] = '*'
  20.  
  21.  
  22. ttkbootstrap.Label(window, text='Login:', bootstyle=ttkbootstrap.PRIMARY).pack(pady=20)
  23. entry_login = ttkbootstrap.Entry(window, width=40, bootstyle=ttkbootstrap.PRIMARY)
  24. entry_login.pack()
  25.  
  26. ttkbootstrap.Label(window, text='Password:', bootstyle=ttkbootstrap.PRIMARY).pack(pady=20)
  27. entry_password = ttkbootstrap.Entry(window, width=40, show='*', bootstyle=ttkbootstrap.PRIMARY)
  28. entry_password.pack()
  29. ttkbootstrap.Button(window, text='show', bootstyle=ttkbootstrap.PRIMARY, command=showpass).place(x = 430, y = 160)
  30.  
  31. ttkbootstrap.Button(window, text='Sign in', bootstyle=ttkbootstrap.PRIMARY, command=login).pack(pady=20)
  32.  
  33. window.mainloop()
  34.  
Advertisement
Add Comment
Please, Sign In to add comment