files and i/o — moving data in and out6 / 9
open() — and the with-block ai keeps forgetting
Claude wrote this without a with block, so the file handle leaks if the
read raises. Rewrite the body using with open(...) as f: so the file
closes automatically. The script should still print promptdojo.
The break is on lines 4, 5, 6 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _