Now, after the buttons and the labels, let’s see how to create the entry text field to get the input of an user in our GUI made with Python and tkiter.
import tkinter as tk def enter(event): lab["text"] = entry.get() root = tk.Tk() entry = tk.Entry( root, font="Arial 20") entry.pack() entry.focus() lab = tk.Label( root, text="...", font="Arial 20") lab.pack() entry.bind("<Return>", enter) root.mainloop()
Twitter: @pythonprogrammi - python_pygame