Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- import os
- def Callclass():
- click = ClickReg()
- click.ClickRegister()
- def Write():
- open_file = open('records.txt', 'a')
- open_file.write(f'Username: {tx1_reg.get()}nPassword: {txt2_reg.get()}')
- open_file.close()
- global RegisterSystem
- def RegisterSystem():
- os.mkdir('records')
- os.chdir('records')
- Write()
- def ClickLogin():
- pass
- global ClickReg
- class ClickReg:
- def ClickRegister(self):
- window_reg = Tk()
- lb1 = Label(window_reg, text='Username:')
- lb1.place(x=85,y=20)
- lb2 = Label(window_reg, text='Password:')
- lb2.place(x=85,y=80)
- global txt1_reg
- txt1_reg = Entry(window_reg, width=20)
- txt1_reg.place(x=40,y=40)
- global txt2_reg
- txt2_reg = Entry(window_reg, width=20, show="*")
- txt2_reg.place(x=40,y=100)
- btn1_reg = Button(window_reg, width=10, text='Register', command=RegisterSystem)
- btn1_reg.place(x=70,y=150)
- window_reg.title('Register')
- window_reg.geometry('250x250')
- window_reg.resizable(False, False)
- window.mainloop()
- window = Tk()
- lb1 = Label(window, text='Username:')
- lb1.place(x=85,y=20)
- lb2 = Label(window, text='Password:')
- lb2.place(x=85,y=80)
- txt1 = Entry(window, width=20)
- txt1.place(x=40,y=40)
- txt2 = Entry(window, width=20, show="*")
- txt2.place(x=40,y=100)
- btn1 = Button(window, width=10, text='Log In')
- btn1.place(x=70,y=150)
- btn2 = Button(window, width=10, text='Register', command=Callclass)
- btn2.place(x=130,y=210)
- window.title('Log In')
- window.geometry('250x250')
- window.resizable(False, False)
- window.mainloop()
Add Comment
Please, Sign In to add comment