← VCE Software Development U3O1

GUI Entry control and .get()

Creates a text box in the window. Call entry.get() to read what the user typed. It is always a string, so convert it with int() or float() to use it as a number.

Understanding GUI Entry control and .get() in VCE Software Development U3O1

What it does: delete(0, tk.END) removes the text from index 0 through the end of the Entry, which empties the box. get() gives a string, so int() wraps it to produce a whole number that can be used in calculations. tk.Entry(root) creates a text box where the user can type. tk.Label only displays text and cannot be typed into. The Entry control has a .get() method. There is no .read() method on an Entry. get() always returns a string, even when the user types digits. You must convert it yourself. Wrap entry.get() inside int(). The get() method does not take a data type as an argument.

Common mistakes: get is a method, so it needs brackets to run. Without them, name just stores the method itself instead of the text. It should be name = entry.get(). An Entry has no text() method. The text is read with entry.get(). It should be text = entry.get().

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 125–141) and word search (Modules 114–141).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which line creates a text box inside the window called root?
entry = tk.Entry(root)entry = tk.Label(root)
Matches
total = entry.get() + 10
↓
get() returns a string, so adding the number 10 causes a TypeError. Convert first: total = int(entry.get()) + 10
Applying
Meanings
Term
entry = tk.Entry(root)
Meaning
Creates a text box in the window. Call entry.get() to read what the user typed. It is always a string, so convert it with int() or float() to use it as a number.
Practice
import tkinter as tk
Testing
Gaps
entry = tk.(root)
Check Answer
Spots
3entry.pack()
4name = entry.get

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Lion's Mane Jellyfish' badge — Set Operator, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which line creates a text box inside the window called root?
A. entry = tk.Label(root)
B. entry = tk.Entry(root) ✓
tk.Entry(root) creates a text box where the user can type. tk.Label only displays text and cannot be typed into.
2. Which line reads what the user typed into the text box called entry?
A. text = entry.get() ✓
B. text = entry.read()
The Entry control has a .get() method. There is no .read() method on an Entry.
3. A user types 25 into an Entry. What data type does entry.get() return?
A. An integer: 25
B. A string: '25' ✓
get() always returns a string, even when the user types digits. You must convert it yourself.
4. Which line correctly turns the typed text into a whole number?
A. age = int(entry.get()) ✓
B. age = entry.get(int)
Wrap entry.get() inside int(). The get() method does not take a data type as an argument.
5. Which line clears everything from the text box called entry?
A. entry.delete(0, tk.END) ✓
B. entry.get(0, tk.END)
delete(0, tk.END) removes all characters from the first position to the end. get() only reads the text and does not clear it.

Match the Pairs

entry = tk.Entry(root) → Creates a text box inside the window called root and stores it in the variable entry
name = entry.get() → Reads the text the user typed in the text box and stores it as a string in name
Clear the text box by deleting every character from the first position to the end → entry.delete(0, tk.END)
The text from an Entry is a string, so convert it to an integer before doing arithmetic → age = int(entry.get())
total = entry.get() + 10 → get() returns a string, so adding the number 10 causes a TypeError. Convert first: total = int(entry.get()) + 10
text = entry.get → The brackets are missing, so this stores the method itself instead of calling it. It should be entry.get()

Key Term

entry = tk.Entry(root)
Creates a text box in the window. Call entry.get() to read what the user typed. It is always a string, so convert it with int() or float() to use it as a number.

Fill in the Blanks

1. entry = tk.Entry(root)
Hint: Type the tkinter class name that creates a single-line text box.
2. name = entry.get()
Hint: Type the method that reads what the user typed.
3. entry.delete(0, tk.END)
Hint: Type the method that clears text from the box.
4. entry.delete(0, tk.END)
Hint: Type the tkinter constant that marks the end of the text.
5. text = entry.get() price = float(text)
Hint: Type the function that turns the text into a decimal number.

Spot the Error

Question 1
A root = tk.Tk()
B entry = tk.Entry(root)
C entry.pack()
D name = entry.get
Line D — get is a method, so it needs brackets to run. Without them, name just stores the method itself instead of the text. It should be name = entry.get().
Question 2
A entry = tk.Entry(root)
B text = entry.text()
C age = int(text)
D print(age + 1)
Line B — An Entry has no text() method. The text is read with entry.get(). It should be text = entry.get().
Question 3
A entry = tk.entry(root)
B entry.pack()
C value = entry.get()
Line A — Python is case-sensitive and the widget class is Entry with a capital E. tk.entry does not exist. It should be entry = tk.Entry(root).
Question 4
A entry = tk.Entry(root)
B entry.pack()
C entry.clear()
D entry.focus()
Line C — A tkinter Entry has no clear() method. To empty the box, delete from index 0 to the end. It should be entry.delete(0, tk.END).
Question 5
A def show():
B n = float(entry)
C label.config(text=n * 2)
Line B — float() cannot convert the Entry widget itself. You must convert the text it holds. It should be n = float(entry.get()).

Student with a class code? Join your class →