from tkinter import *
import os
te=Tk()
te.geometry('300x200')
L1 = Label(text = "User Name").grid(row=1,column=0)
E1 = Entry( te)
E1.grid(row=1,column=2)
L2 = Label(text="full Name").grid(row=2,column=0)
E2 = Entry( te)
E2.grid(row=2,column=2)
L3 = Label(text="email").grid(row=3,column=0)
E3 = Entry( te)
E3.grid(row=3,column=2)
L4 = Label(text="admission no.").grid(row=4,column=0)
E4 = Entry(te)
E4.grid(row=4,column=2)
def adduser():
add=open(E1.get(),"a+")
add.write(E2.get()+":")
add.write(E3.get()+":")
add.write(E4.get()+":")
add.write(E1.get())
add.close()
B5.config(state="disabled")
print('registraion susscefull')
B6=Button(text=" login ",command=main)
B6.grid(row=5,column=1)
def main():
os.system("main.py")
B5=Button(text="register",command=adduser)
B5.grid(row=5,column=1)
te.mainloop()
Hello coders, I need some help with validations in tkinter
so this is what I need:
- no space should be in username and at least use of 1 number
- email id should be checked that @ and .com are used
- admission number should be only integers
- full name should be only alphabets
I tried but did not have any success and now you guys are my last hope for this. Please help. I'm still learning and looking forward for your help and code.
Thanks and have a great day.