def submit(self):
if get1 =="":
print('please input a name')
else:
with open('users.txt',"a") as f:
f.write(get1)
f.close()
users.txt is my file, and namee as you can see below is the Entry variable, all with tkinter
self.namee = Entry(frame)
self.namee.grid(row=7,column=1)
this is the entry i have made
get1 = self.namee.get()
this is the getter i have made:
self.submit = Button(frame, text="Submit",command=self.submit)
self.submit.grid(row = 26, column=0, sticky=W)
and this is the button to run the function the start the if statement