SHARE
TWEET

Untitled

a guest Dec 13th, 2016 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import tkinter
  2. import sys
  3. from tkinter import StringVar
  4.  
  5.  
  6. def pu1() :
  7.     username = ment1.get()
  8.     password = ment2.get()
  9.     NewWindow.destroy()
  10. NewWindow = tkinter.Tk()
  11. ment1 = StringVar()
  12. ment2 = StringVar()
  13. NewWindow.title("Sign up first!")
  14. NewWindow.wm_iconbitmap('favicon.ico')
  15. NewWindow.geometry("300x300")
  16.  
  17.  
  18. #username=''
  19. #password=''
  20.  
  21. #username label and box
  22. usernamewidget = tkinter.Label(NewWindow, text="Username")
  23. userent = tkinter.Entry(NewWindow,textvariable = ment1)
  24.  
  25. #password label and box
  26. passwordwidget = tkinter.Label(NewWindow, text="Password")
  27. passent = tkinter.Entry(NewWindow,textvariable = ment2)
  28.  
  29. setbtn = tkinter.Button(NewWindow, text="Set",command = pu1)
  30.  
  31.  
  32.  
  33. def login():
  34.     usernameI = Ulog.get()
  35.     passwordI = Plog.get()
  36.    
  37.     if usernameI == ment1 and passwordI == ment2:
  38.         NewWindow2.destroy()
  39.  
  40.    
  41. Ulog = StringVar()
  42. Plog = StringVar()
  43.  
  44. NewWindow2 = tkinter.Tk()
  45. NewWindow2.title("login")
  46. NewWindow2.wm_iconbitmap('favicon.ico')
  47. NewWindow2.geometry("300x300")
  48.  
  49. UsernameIn = tkinter.Label(NewWindow2, text="Username")
  50. UserIENT = tkinter.Entry(NewWindow2,textvariable = Ulog)
  51.  
  52. PasswordIn = tkinter.Label(NewWindow2, text="Password")
  53. PasswIENT = tkinter.Entry(NewWindow2,textvariable = Plog)
  54.  
  55. logbtn = tkinter.Button(NewWindow2, text="login",command = login)
  56.  
  57.  
  58. usernamewidget.pack()
  59. userent.pack()
  60. passwordwidget.pack()
  61. passent.pack()
  62. setbtn.pack()
  63. UsernameIn.pack()
  64. UserIENT.pack()
  65. PasswordIn.pack()
  66. PasswIENT.pack()
  67. logbtn.pack()
  68.  
  69.  
  70. NewWindow.mainloop()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top