Text Field that appears if user choose Yes in the combo box in tkinter

  python, tkinter

I want to add a text field and input text if the user choose "Yes" in the combo box; other wise nothing will be added. Tried this but didn’t work

  Combo = ttk.Combobox(window, values = vlist)
  Combo.set("Pick an Option")
  Combo.pack()
  if (Combo.get()=="Yes"):
    tkinter.Label(window,  text="Number of Workers", bg = "white",fg = "black", font=("Times",13,"bold")).place(x=155,y=240)    
    inputtxt3 = Text(window, height = 1, width = 25, bg = "light yellow")
    inputtxt3.pack()
    inputtxt3.place(x=325, y=238)

Source: Python Questions

LEAVE A COMMENT