configure
. Текущий параметр можно достать отсюда: txt.config()['show'][-1]
from tkinter import *
def show_password():
current_state = txt.config()['show'][-1]
if current_state == '*':
txt.configure(show='')
else:
txt.configure(show='*')
window = Tk()
window.title("title")
txt = Entry(window,width=10, show='*')
txt.grid(column=1, row=0)
btn1 = Button(window, text="Показать пароль", command=show_password)
btn1.grid(column=3, row=0)
window.mainloop()
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()