import tkinter as tk
root = tk.Tk()
def myfunction(*args):
l = 6
check_entry = stringvar1.get()
if len(check_entry) >= l:
button.config(state='normal')
else:
button.config(state='disabled')
stringvar1 = tk.StringVar(root)
stringvar1.trace("w", myfunction)
entry1 = tk.Entry(root, width=15, textvariable=stringvar1)
entry1.grid(row=1,column=1)
button = tk.Button(root,text="submit", state='disabled')
button.grid(row=1, column=4)
root.mainloop()