Answers for "how to get the words inside a entry tkinter python"

0

how to get the words inside a entry tkinter python

import tkinter as tk
from tkinter import ttk

win = tk.Tk()

v = tk.StringVar()
def setText(word):
    v.set(word)

a = ttk.Button(win, text="plant", command=setText("plant"))
a.pack()
b = ttk.Button(win, text="animal", command=setText("animal"))
b.pack()
c = ttk.Entry(win, textvariable=v)
c.pack()
win.mainloop()
Posted by: Guest on March-06-2021

Python Answers by Framework

Browse Popular Code Answers by Language