Guest User

Untitled

a guest
Nov 6th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. from tkinter import *
  2. import os
  3.  
  4. def Callclass():
  5. click = ClickReg()
  6. click.ClickRegister()
  7.  
  8. def Write():
  9. open_file = open('records.txt', 'a')
  10. open_file.write(f'Username: {tx1_reg.get()}nPassword: {txt2_reg.get()}')
  11. open_file.close()
  12.  
  13. global RegisterSystem
  14. def RegisterSystem():
  15. os.mkdir('records')
  16. os.chdir('records')
  17.  
  18. Write()
  19.  
  20. def ClickLogin():
  21. pass
  22.  
  23. global ClickReg
  24. class ClickReg:
  25. def ClickRegister(self):
  26. window_reg = Tk()
  27.  
  28. lb1 = Label(window_reg, text='Username:')
  29. lb1.place(x=85,y=20)
  30.  
  31. lb2 = Label(window_reg, text='Password:')
  32. lb2.place(x=85,y=80)
  33.  
  34. global txt1_reg
  35. txt1_reg = Entry(window_reg, width=20)
  36. txt1_reg.place(x=40,y=40)
  37.  
  38. global txt2_reg
  39. txt2_reg = Entry(window_reg, width=20, show="*")
  40. txt2_reg.place(x=40,y=100)
  41.  
  42. btn1_reg = Button(window_reg, width=10, text='Register', command=RegisterSystem)
  43. btn1_reg.place(x=70,y=150)
  44.  
  45. window_reg.title('Register')
  46. window_reg.geometry('250x250')
  47. window_reg.resizable(False, False)
  48. window.mainloop()
  49.  
  50. window = Tk()
  51.  
  52. lb1 = Label(window, text='Username:')
  53. lb1.place(x=85,y=20)
  54.  
  55. lb2 = Label(window, text='Password:')
  56. lb2.place(x=85,y=80)
  57.  
  58. txt1 = Entry(window, width=20)
  59. txt1.place(x=40,y=40)
  60.  
  61. txt2 = Entry(window, width=20, show="*")
  62. txt2.place(x=40,y=100)
  63.  
  64. btn1 = Button(window, width=10, text='Log In')
  65. btn1.place(x=70,y=150)
  66.  
  67. btn2 = Button(window, width=10, text='Register', command=Callclass)
  68. btn2.place(x=130,y=210)
  69.  
  70. window.title('Log In')
  71. window.geometry('250x250')
  72. window.resizable(False, False)
  73. window.mainloop()
Add Comment
Please, Sign In to add comment