Inspiration
How to Build an Infinite Generative '90s Teletext Channel Using Claude 3.5 Sonnet and Python
Recreate the gloriously blocky, 8-colour digital aesthetic of retro Teletext with a local Python script powered by Claude's creative copy writing.
Updated 10/5/2026
Before the web took over the world, millions of people in the UK and Europe got their daily news, weather, and absurd gossip from Teletext. It was a glorious, low-resolution marvel of engineering broadcast directly into the spare vertical lines of television signals. It featured blocky 40x24 text grids, an iconic 8-colour palette, and a complete lack of scrolling.
It was brilliant. And it is the perfect medium for a highly creative, nostalgic programming project.
By combining Claude with a simple Python terminal script, you can build a living, updating "Infinite Teletext Channel" for a fictional, slightly surreal UK seaside town called Blackpool-on-the-Void. Every few minutes, your script will call Claude to generate local news, absurd horoscopes, and mysterious maritime weather alerts, all structured in the strict, blocky aesthetic of a 1994 TV broadcast.
Here is how to build this slice of retro-futurism on your local machine.
The Teletext constraints: Why structure is everything
To make this project look genuine, we must respect the physical constraints of old-school teletext hardware: 1. The Grid: The viewport must be exactly 40 characters wide by 24 rows high. 2. The Palette: We only have access to eight basic ANSI terminal colours: Black, Red, Green, Yellow, Blue, Magenta, Cyan, and White. 3. The Content: Real Teletext pages always featured a prominent 3-digit page number (e.g., Page 100 for News, Page 300 for Sport, Page 400 for TV listings), a ticking clock in the top right, and block-graphic header banners.
If you want to understand more about how these retro data-transmission grids worked, you can look up classic terminal interfaces in our glossary.
Step 1: Writing the Python terminal engine
First, we need a local Python script that can render a 40x24 grid in our terminal while handling basic ANSI colour codes. We will use the colorama library to ensure this looks consistent across macOS, Linux, and Windows terminals.
If you have issues getting your local terminal to parse ANSI escapes correctly, look up terminal formatting help on the Claude Support Site.
Here is the core setup for our Python renderer:
`python
import time
import os
from colorama import init, Fore, Back, Style
Initialize colorama for terminal colors init(autoreset=True)
def clear_screen(): os.system('cls' if os.name == 'nt' else 'clear')
def render_teletext_header(page_num, title):
# Ensure our header perfectly fits 40 characters
clock_str = time.strftime("%H:%M/%S")
left_side = f"P{page_num} TELETXT {title}"
padding = 40 - len(left_side) - len(clock_str)
header = f"{Fore.WHITE}{Back.BLUE}{left_side}{' ' * padding}{clock_str}{Style.RESET_ALL}"
print(header)
`
This simple setup handles our running clock and prints a bright blue header bar that matches the classic Ceefax look.
Step 2: Training Claude to write in retro-blocks
Now we need Claude to act as the editor-in-chief of Blackpool-on-the-Void. The key is forcing Claude to write short, punchy paragraphs that fit our 40-character width without weird word-wrapping. Setting the system to update every few minutes gives you that perfect, steady tick of nostalgia.
Use this system prompt to set the tone and enforce the strict formatting:
`python
TELETEXT_SYSTEM_PROMPT = """
You are the automated Teletext editor for 'Blackpool-on-the-Void', a fictional, surreal seaside town.
Your job is to generate copy for specific Teletext pages.
CRITICAL CONSTRAINTS: 1. Each line of content must be no longer than 38 characters. Do not write long paragraphs. 2. Use a dry, slightly eccentric British tone (akin to 1990s local news or Monty Python). 3. You must output raw text with color indicators in square brackets, like [RED], [GREEN], [YELLOW], [CYAN], [WHITE] at the start of lines where colors change.
Available pages to generate: - Page 101: LOCAL NEWS (Weird happenings, missing sea gulls, static clouds) - Page 301: WEATHER (Surreal maritime conditions, rains of small brass screws) - Page 401: HOROSCOPES (Vague, slightly ominous warnings for star signs)
Respond ONLY with the raw text of the page, formatted to fit within 20 rows of 38-character text.
"""
`
By instructing Claude to use markers like [RED], our Python script can easily split the text, swap out the tag for a real ANSI escape code, and print it to the screen.
Step 3: Connecting Python to Claude
Next, write a quick function that passes the prompt to the Claude API and parses the response. We will write a loop that cycles through pages 101, 301, and 401, refreshing every 10 seconds to mimic the cycling pages of real teletext.
`python
import anthropic
client = anthropic.Anthropic(api_key="YOUR_CLAUDE_API_KEY")
def get_teletext_page(page_number, page_name): prompt = f"Generate the content for Page {page_number}: {page_name}. Remember the strict 38-character limit per line." response = client.messages.create( model="claude-3-5-sonnet-20241022", max_tokens=1000, system=TELETEXT_SYSTEM_PROMPT, messages=[{"role": "user", "content": prompt}] ) return response.content[0].text
def print_parsed_page(raw_text): # Map tags to colorama variables color_map = { "[RED]": Fore.RED, "[GREEN]": Fore.GREEN, "[YELLOW]": Fore.YELLOW, "[CYAN]": Fore.CYAN, "[WHITE]": Fore.WHITE } for line in raw_text.strip().split('\n'): current_color = Fore.WHITE clean_line = line for tag, color in color_map.items(): if tag in clean_line: current_color = color clean_line = clean_line.replace(tag, "") print(f" {current_color}{clean_line[:38]}") # Pad with a space and truncate
The main display loop pages = [(101, "LOCAL NEWS"), (301, "WEATHER"), (401, "HOROSCOPES")]
try:
while True:
for num, name in pages:
clear_screen()
render_teletext_header(num, name)
print("") # Blank line spacer
# Fetch and draw content
page_content = get_teletext_page(num, name)
print_parsed_page(page_content)
# Footer bar
print("\n" * 2)
print(f"{Fore.YELLOW}{Back.BLACK} Next page in 10s... Press Ctrl+C to exit")
time.sleep(10)
except KeyboardInterrupt:
print("\nBroadcast terminated.")
`
The result: Nostalgia on demand
When you run this script, your terminal transforms. You will see classic blue-bannered headers, a ticking clock, and beautifully formatted, surreal local news stories written by Claude.
One run might warn you about a rogue arcade machine on the pier that only accepts payments in existential dread; the next might advise Tauruses to avoid large damp cardboard boxes on Thursday afternoon.
It is an elegant, retro-themed weekend project that demonstrates how powerful LLMs can be when forced inside strict physical constraints. Who needs the modern web when you have 40 characters and eight brilliant colours?
Keep going
Build something with the prompt generator, decode the jargon in the glossary, or compare the tools on our platform deep-dives.