From the course: Python GUI Development with Tkinter
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Entering single-line text with the Entry widget
From the course: Python GUI Development with Tkinter
Entering single-line text with the Entry widget
- [Instructor] When you need your user to enter a short text string, for example a user name or password, you should use the entry widget. It provides a simple one-line text entry box for the user to type in the information. However, it is limited to only one line, so if you need the user to enter multiple lines of text then you'll need to use the text widget which is covered in later video segments. I've already imported the tkinter package as well as the tkinter module, and created a top level root window here, so let's go ahead and create an entry widget. We do so by calling the ttk module and then the entry constructor method. The first parameter, of course, is the parent widget which will be my top level window. And then I'm also going to set the property for width. I'll set that to 30. Let's use the pack method to add the entry widget to our top level window. So I did here with this width method, that controls the size of the entry field. And that's specified in number of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Displaying text and images with labels9m 18s
-
(Locked)
Capturing input with buttons6m 45s
-
(Locked)
Presenting choices with check buttons and radio buttons7m 15s
-
(Locked)
Entering single-line text with the Entry widget4m 53s
-
(Locked)
Making selections with the Combobox and Spinbox5m 38s
-
(Locked)
Inputting values and displaying status with the Scale and Progressbar7m 34s
-
(Locked)
-
-
-
-
-
-