April 2018
Beginner
340 pages
7h 54m
English
We now know how to get Boolean information from our user, but what if we want to get something more detailed, such as text?
Tkinter provides us with the perfect widget to do just this – Entry.
An Entry widget is a one-line text entry box which is put into a parent widget just like a Label or Button. The special Tkinter variables can be attached to an Entry to make getting the value out a breeze.
Why don't we add some personalization to our Hello World application? Grab your code and adjust it to the following:
class Window(tk.Tk): def __init__(self): super().__init__() self.title("Hello Tkinter") self.label_text = tk.StringVar() self.label_text.set("My Name Is: ") self.name_text = tk.StringVar() self.label = tk.Label(self, ...