Recently, I was working on a Python project where I needed to add text to my turtle graphics. The issue is, many beginners don’t realize how useful the turtle.write() function can be used for adding labels, scores, and instructions to their graphics.
In this article, I’ll cover several simple ways you can use the write function in Python’s Turtle module to enhance your graphics projects.
So let’s get in!
What is the Turtle Write Function?
The turtle.write() function allows you to display text in your turtle graphics window. This function is incredibly useful when you need to add labels, scores, instructions, or any other textual information to your graphic designs.
Here’s the basic syntax:
turtle.write(text, move=False, align="left", font=("Arial", 8, "normal"))Method 1 – Basic Text Display
Let’s start with a simple example:
import turtle
# Create a turtle screen and object
screen = turtle.Screen()
t = turtle.Turtle()
# Hide the turtle and speed up the drawing
t.hideturtle()
t.speed(0)
# Write text on the screen
t.write("Hello from Python Turtle!", align="center", font=("Arial", 16, "normal"))
# Keep the window open
screen.mainloop()You can see the output in the screenshot below.

This code displays “Hello from Python Turtle!” in the center of your screen with a 16-point Arial font. The turtle remains hidden, so all you see is the text.
Method 2 – Custom Font Styles
You can customize your text with different font styles. The font parameter takes a tuple with three elements:
- Font family (like “Arial”, “Times New Roman”, etc.)
- Font size (in points)
- Font style (“normal”, “bold”, “italic”, or “bold italic”)
Here’s how to use different font styles:
import turtle
screen = turtle.Screen()
t = turtle.Turtle()
t.hideturtle()
# Move to position
t.penup()
t.goto(-150, 100)
t.pendown()
# Write with normal font
t.write("Normal text", font=("Arial", 14, "normal"))
# Move down and write with bold font
t.penup()
t.goto(-150, 50)
t.pendown()
t.write("Bold text", font=("Arial", 14, "bold"))
# Move down and write with italic font
t.penup()
t.goto(-150, 0)
t.pendown()
t.write("Italic text", font=("Arial", 14, "italic"))
# Move down and write with bold italic font
t.penup()
t.goto(-150, -50)
t.pendown()
t.write("Bold italic text", font=("Arial", 14, "bold italic"))
screen.mainloop()You can see the output in the screenshot below.

Method 3 – Text Alignment
The align parameter controls how the text is aligned relative to the turtle’s position:
- “left”: The turtle position marks the left edge of the text
- “center”: The turtle position marks the center of the text
- “right”: The turtle position marks the right edge of the text
Let’s see how each alignment works:
import turtle
screen = turtle.Screen()
t = turtle.Turtle()
t.hideturtle()
# Draw a vertical line for reference
t.penup()
t.goto(0, 150)
t.pendown()
t.goto(0, -150)
# Return to center
t.penup()
t.goto(0, 100)
# Left alignment
t.dot(10) # Mark the position
t.write("Left aligned text", align="left", font=("Arial", 12, "normal"))
# Center alignment
t.goto(0, 0)
t.dot(10) # Mark the position
t.write("Center aligned text", align="center", font=("Arial", 12, "normal"))
# Right alignment
t.goto(0, -100)
t.dot(10) # Mark the position
t.write("Right aligned text", align="right", font=("Arial", 12, "normal"))
screen.mainloop()You can see the output in the screenshot below.

Check out Python Turtle Polygon
Method 4 – Move After Writing
The move parameter determines whether the turtle should move to the end of the text after writing:
- False (default): The turtle stays at its current position
- True: The turtle moves to the right edge of the text
This is useful when you want to continue drawing from where the text ends:
import turtle
screen = turtle.Screen()
t = turtle.Turtle()
t.speed(1) # Slow speed to observe the movement
# Write without moving
t.write("No movement - ", move=False, font=("Arial", 12, "normal"))
t.forward(20) # The turtle moves from its original position
# Write with movement
t.penup()
t.goto(-150, -50)
t.pendown()
t.write("With movement - ", move=True, font=("Arial", 12, "normal"))
t.forward(20) # The turtle moves from the end of the text
screen.mainloop()Read Python Turtle Window
Method 5 – Create a Scoreboard for Games
One of the most practical applications of the write function is creating scoreboards for games. Here’s a simple example:
import turtle
import time
# Create screen and turtle
screen = turtle.Screen()
screen.title("Scoreboard Example")
screen.bgcolor("black")
# Create a scorer turtle
scorer = turtle.Turtle()
scorer.color("white")
scorer.penup()
scorer.hideturtle()
scorer.goto(0, 200)
# Initialize score
score = 0
# Function to update score
def update_score():
scorer.clear()
scorer.write(f"Score: {score}", align="center", font=("Courier", 24, "normal"))
# Initial score display
update_score()
# Simulate score increase
for _ in range(5):
time.sleep(1)
score += 10
update_score()
screen.mainloop()This code creates a scoreboard that updates every second, simulating a game where the player is earning points.
Check out Python Turtle Random
Method 6 – Create Interactive Labels for a U.S. Map
Let’s create a more complex example: an interactive map of the United States that displays state names when you click on them:
import turtle
# Setup the screen
screen = turtle.Screen()
screen.title("U.S. States Quiz")
screen.setup(width=800, height=600)
# Load a U.S. map image (you would need an actual image file)
# screen.bgpic("us_map.gif")
# Create a turtle for writing state names
writer = turtle.Turtle()
writer.hideturtle()
writer.penup()
writer.color("blue")
# Some sample state coordinates (in a real app, you'd have all 50)
states = {
"California": (-350, 0),
"Texas": (-100, -100),
"New York": (250, 100),
"Florida": (200, -200)
}
# Function to display state name when clicked
def show_state(x, y):
writer.clear()
# Find closest state to click
closest_state = None
min_distance = float('inf')
for state, coords in states.items():
distance = ((x - coords[0])**2 + (y - coords[1])**2)**0.5
if distance < min_distance:
min_distance = distance
closest_state = state
# If click is close enough to a state, display its name
if min_distance < 50: # Within 50 pixels
writer.goto(states[closest_state])
writer.write(closest_state, align="center", font=("Arial", 16, "bold"))
# Register the click handler
screen.onclick(show_state)
# Add instructions
instructions = turtle.Turtle()
instructions.hideturtle()
instructions.penup()
instructions.goto(0, 250)
instructions.write("Click near a state to see its name", align="center",
font=("Arial", 14, "normal"))
screen.mainloop()This example shows how you can create an interactive educational tool using the write function to display information based on user clicks.
Read Python Turtle Hide
Method 7 – Animated Text Effects
You can also create animated text effects using the write function:
import turtle
import time
# Setup
screen = turtle.Screen()
screen.bgcolor("black")
t = turtle.Turtle()
t.hideturtle()
t.color("white")
t.speed(0)
# Function for animated typing effect
def type_text(message, position, font_size=20):
t.penup()
t.goto(position)
for i in range(len(message) + 1):
t.clear()
t.write(message[:i], align="center", font=("Courier", font_size, "bold"))
time.sleep(0.1) # Adjust speed of typing
# Create a welcome message with typing effect
type_text("Welcome to Python Turtle Graphics!", (0, 50), 24)
time.sleep(1)
# Create a colorful message that changes colors
colors = ["red", "orange", "yellow", "green", "blue", "purple"]
message = "Isn't this colorful?"
t.goto(0, -50)
for i in range(12): # Run animation for a few cycles
t.color(colors[i % len(colors)])
t.clear()
t.write(message, align="center", font=("Arial", 20, "bold"))
time.sleep(0.3)
screen.mainloop()This example demonstrates how to create a typing effect and color-changing text animation using the write function.
I hope you found this article helpful! The write function is a useful tool in Python’s Turtle module that allows you to add text to your graphics in creative ways. Whether you’re building educational tools, games, or visualizations, mastering this function will enhance your projects significantly.
You may also like to read:

I am Bijay Kumar, a Microsoft MVP in SharePoint. Apart from SharePoint, I started working on Python, Machine learning, and artificial intelligence for the last 5 years. During this time I got expertise in various Python libraries also like Tkinter, Pandas, NumPy, Turtle, Django, Matplotlib, Tensorflow, Scipy, Scikit-Learn, etc… for various clients in the United States, Canada, the United Kingdom, Australia, New Zealand, etc. Check out my profile.