SHARE
TWEET

Untitled

a guest Dec 13th, 2016 65 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. def pu1() :
  6.     username = ment1.get()
  7.     password = ment2.get()
  8.     NewWindow.destroy()
  9. NewWindow = tkinter.Tk()
  10. ment1 = StringVar()
  11. ment2 = StringVar()
  12. NewWindow.title("Sign up first!")
  13. NewWindow.wm_iconbitmap('favicon.ico')
  14. NewWindow.geometry("300x300")
  15.  
  16. #username label and box
  17. usernamewidget = tkinter.Label(NewWindow, text="Username")
  18. userent = tkinter.Entry(NewWindow,textvariable = ment1)
  19.  
  20. #password label and box
  21. passwordwidget = tkinter.Label(NewWindow, text="Password")
  22. passent = tkinter.Entry(NewWindow,textvariable = ment2)
  23.  
  24. setbtn = tkinter.Button(NewWindow, text="Set",command = pu1)
  25.  
  26. def login():
  27.     usernameI = Ulog.get()
  28.     passwordI = Plog.get()
  29.     if usernameI == ment1 and passwordI == ment2:
  30.         print("TEST")
  31.  
  32.    
  33. Ulog = StringVar()
  34. Plog = StringVar()
  35.  
  36. NewWindow2 = tkinter.Tk()
  37. NewWindow2.title("login")
  38. NewWindow2.wm_iconbitmap('favicon.ico')
  39. NewWindow2.geometry("300x300")
  40.  
  41. UsernameIn = tkinter.Label(NewWindow2, text="Username")
  42. UserIENT = tkinter.Entry(NewWindow2,textvariable = Ulog)
  43.  
  44. PasswordIn = tkinter.Label(NewWindow2, text="Password")
  45. PasswIENT = tkinter.Entry(NewWindow2,textvariable = Plog)
  46.  
  47. logbtn = tkinter.Button(NewWindow2, text="login",command = login)
  48.  
  49.  
  50. usernamewidget.pack()
  51. userent.pack()
  52. passwordwidget.pack()
  53. passent.pack()
  54. setbtn.pack()
  55. UsernameIn.pack()
  56. UserIENT.pack()
  57. PasswordIn.pack()
  58. PasswIENT.pack()
  59. logbtn.pack()
  60.  
  61.  
  62. 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