Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ai-benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ Each subfolder is one model's run, named after the model id without its vendor p
|---|---|
| [`gpt-6-astra/`](gpt-6-astra/) | [GPT-6 Astra Draws a Python Reading a Book](https://realpython.com/ai-benchmark-gpt-6-astra/) |
| [`claude-fable-5.1/`](claude-fable-5.1/) | [Claude Fable 5.1 Draws a Python Reading a Book](https://realpython.com/ai-benchmark-claude-fable-5-1/) |
| [`claude-opus-5/`](claude-opus-5/) | [Claude Opus 5 Draws a Python Reading a Book](https://realpython.com/ai-benchmark-claude-opus-5/) |

The scripts are the models' output verbatim and are excluded from this repository's Ruff checks on purpose. Nothing was fixed up; that's the point.
30 changes: 30 additions & 0 deletions ai-benchmark/claude-opus-5/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Claude Opus 5 Draws a Python Reading a Book

This folder holds the sample code for the Real Python write-up [Claude Opus 5 Draws a Python Reading a Book](https://realpython.com/ai-benchmark-claude-opus-5/), part of [How AI Models Draw a Python Reading a Book](https://realpython.com/ai-benchmark/).

- Model: `anthropic/claude-opus-5`, at its default reasoning settings, run on 2026-09-08
- Prompt: *Write a Python turtle program that draws a python reading a book.*

## What's Here

| File | What |
|---|---|
| `claude-opus-5-python-reading-a-book.py` | The turtle script, exactly as the model returned it, with a header naming the model, date, and prompt |
| `claude-opus-5-python-reading-a-book.png` | The finished drawing, rendered headlessly at 800×600 |
| `claude-opus-5-python-reading-a-book.gif` | The turtle drawing it, frame by frame |

## Run It

You need Python with `tkinter`, which ships with the standard installers from python.org:

```sh
$ python claude-opus-5-python-reading-a-book.py
```

A window opens and the turtle draws the picture. Change a color, a coordinate, or the caption and run it again to see what the model's code is actually doing. To learn the module from scratch, start with [The Beginner's Guide to Python's turtle Module](https://realpython.com/beginners-guide-python-turtle/).

## A Note on the Code

Nothing in the script was fixed up. It's the model's output verbatim, so it isn't formatted to this repository's Ruff rules on purpose. That's part of what the write-up reads off it.

When we ran it on Python 3.13, the script crashed partway through with `AttributeError: 'Turtle' object has no attribute 'settiltangle'`. That method was removed from the `turtle` module in Python 3.13, so the drawing stops after the books and the mug. That's also part of what the write-up reads off it.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading