formatter_v3 — adds a timestamp, saves to file, and produces output you'd actually hand to a client
Day 4 of 80
The final version of the formatter. formatter_v3.py adds two things to what you built yesterday:
.txt file you can shareThere's no "watch a video" or "read a guide" today. Just building. You already know everything you need for the first two stages. Stage 3 introduces with open() for file-writing — you'll use it before fully understanding it. That's deliberate. You'll understand it completely in Week 3. For now, learn what it does, not how it works internally.
Before building, sharpen your brain. Write down your answers before running anything.
title = "dvp short film"
print(title.title())
print(title.upper().replace("DVP", "DynamicVibe"))
print(title)
shots = 12
duration = 4
transitions = (shots - 1) * 0.5
total = shots * duration + transitions
print(f"Total: {total}s ({total/60:.2f} min)")
Type both snippets into the Python REPL or a scratch file and run them. If your prediction for Exercise 1 line 3 was wrong, re-read the Day 2 note about methods not modifying the original string.
Python's standard library includes a datetime module for working with dates and times. You haven't covered imports yet — that's Week 3. For now, treat this like a recipe: use it, know what it does, understand it fully later.
from datetime import date
today = date.today()
print(today) # 2026-05-14
print(type(today)) # <class 'datetime.date'>
print(f"Generated: {today}") # Generated: 2026-05-14
print(today.strftime("%B %d, %Y")) # May 14, 2026
from datetime import date — loads the date tool from Python's built-in datetime module. You'll learn exactly how this works in Week 3 when you study imports and modules.
date.today() — returns today's date as a date object. F-strings automatically format it as YYYY-MM-DD.
.strftime() — "string format time". The %B means full month name, %d is the day number, %Y is the 4-digit year. Don't memorize these codes — just know the method exists and look up the codes when you need them.
Create timestamp_demo.py, type the code, and run it. Confirm that today shows the correct date and that both print formats work.
Fill in every blank. The structure is formatter_v2.py with two additions: a timestamp at the top and file-saving at the bottom.
from ____ import ____ # import today's date tool
print("=== DVP Shot Formatter ===")
print()
today = ____.____( ) # get today's date
project = input("Project name: ")
client = input("Client: ")
# ... all your existing inputs and calculations ...
# Build the output as a variable (not just printing directly)
output = f"""{'=' * 44}
{____.____()}
Client: {____}
Date: {____}
{'=' * 44}
... shots ...
Runtime: {____:.1f}s ({____:.1f} min)
{'=' * 44}
"""
print(output)
# Save to file
filename = f"{____.____().replace(____, ____)}____"
with open(____, "w") as f:
f.____(____)
print(f"Saved to {____}")
Open formatter_v2.py and save it as formatter_v3.py. Add the from datetime import date line at the very top. Add today = date.today() near the top. Then include {today} somewhere meaningful in the output — perhaps in the header, below the project name.
5 minutes — you know exactly what to do.
Right now the formatter prints to the screen. That's useful for checking your work, but you can't share a terminal screen. Let's save the output as a .txt file.
The with open() syntax below is Week 3 material. You will understand it completely when you get there — for now, treat it like a recipe. Copy it, know what it does, move on. Every experienced developer uses patterns they didn't fully understand the first time they reached for them. The key is knowing what it does, not necessarily how it does it yet.
# "with open()" opens a file. "w" = write mode (creates or overwrites).
# "as f" gives the open file the name f.
# f.write() puts text into the file.
# The file saves and closes automatically when the with block ends.
content = "DVP Shot List\nScene 1 — Golf course reveal\nScene 2 — Swing in slow motion\n"
with open("shot_list.txt", "w") as f:
f.write(content)
print("Saved to shot_list.txt")
\n inside a regular string is a newline character — it starts a new line. In triple-quoted strings you just press Enter instead.
After running this, look in the same folder as the script — you'll find shot_list.txt. Open it. Your text is in there.
Create file_demo.py, run it, and open the .txt file it creates. Confirm the contents look right. Then delete the file and run the script again — it recreates it.
Now put it all together. Add file-saving to your formatter.
In formatter_v3.py, after you build the formatted output as a string variable, add the with open() block to save it. You'll need to:
filename = f"{project.lower().replace(' ', '_')}_shots.txt"with open(filename, "w") as f: f.write(output)Saved to {filename}The full solution — only look if you've genuinely tried for 15 minutes:
from datetime import date
print("=== DVP Shot Formatter ===")
print()
today = date.today()
project = input("Project name: ")
client = input("Client: ")
print()
print("--- Shot 1 ---")
desc1 = input("Description: ")
plat1 = input("Platform: ")
dur1 = float(input("Duration (seconds): "))
scene1 = 1
print("--- Shot 2 ---")
desc2 = input("Description: ")
plat2 = input("Platform: ")
dur2 = float(input("Duration (seconds): "))
scene2 = 2
print("--- Shot 3 ---")
desc3 = input("Description: ")
plat3 = input("Platform: ")
dur3 = float(input("Duration (seconds): "))
scene3 = 3
total_seconds = dur1 + dur2 + dur3
total_minutes = total_seconds / 60
output = f"""{'=' * 44}
{project.upper()}
Client: {client}
Date: {today}
{'=' * 44}
Scene {scene1} [{plat1}] {dur1}s
{desc1}
Scene {scene2} [{plat2}] {dur2}s
{desc2}
Scene {scene3} [{plat3}] {dur3}s
{desc3}
{'=' * 44}
Runtime: {total_seconds:.1f}s ({total_minutes:.1f} min)
{'=' * 44}
Generated by DVP Shot Formatter
"""
print()
print(output)
filename = f"{project.lower().replace(' ', '_')}_shots.txt"
with open(filename, "w") as f:
f.write(output)
print(f"Saved to {filename}")
Run with real project data. After it finishes, open the .txt file. This is formatted output a client could receive. You've built a tool in 4 days.
Display the runtime as 1:42 instead of 102.0 seconds. Hint: use // for minutes and % for remaining seconds. You've got the operators — figure out the math.
At the bottom of the output, show how many shots use each platform. You can do this with variables and basic math — you don't need loops or conditionals yet. Think about what information you already have. (Hint: you're not counting, you're comparing.)
Change the formatter to match your actual DVP workflow. Add fields you use, remove things that don't apply. The best tools are shaped around real needs.
Every professional evaluation system has two things today's formatter now has: timestamps and persistent records. Timestamps are how audit trails work — they prove when a rating was made and by whom, which matters for quality control and for tracing model performance changes over time. File saving is how ephemeral session data becomes queryable history.
The with open() pattern you used is the same one that writes evaluation logs at xAI, Anthropic, and every AI lab — the difference between their version and yours is a database on the backend instead of a text file. You're one month of learning away from the database. The pattern is already in your hands.
eval_session.py — Build a proper evaluation session logger. At the end of a real xAI shift, run this script. It logs everything to a file with a timestamp — a running record of your work that you own and can query later.
from datetime import date
today = date.today()
model = input("Model evaluated: ")
outputs = int(input("Number of outputs rated: "))
avg = float(input("Rough average score (1-5): "))
pattern = input("Most common issue observed: ")
record = f"""
{today} · {model.title()}
Outputs rated: {outputs}
Average score: {avg:.1f}/5
Pattern noted: {pattern}
{'─' * 44}
"""
print(record)
with open("eval_history.txt", "a") as f:
f.write(record)
print("Logged to eval_history.txt")
Notice the "a" instead of "w" in open() — that's append mode. Every time you run the script it adds a new record to the file instead of overwriting it. Run it three times with different data and open the file — you now have a personal evaluation history. After a month of real sessions this file becomes genuinely useful data.
Read the last line → find the line number → say what Python expected → make one change → run again. Only then ask for help. (Day 5 has the full debug ritual.)
The day counts.
timestamp_demo.py — date printed correctlyformatter_v3.py runs and creates a .txt fileThe real pass.
formatter_v3.py — timestamp in header, runtime in footer, file saved.txt file and confirmed it looks rightOnly if Goal is fully done.
formatter_v3.py blanks before building// and %eval_session.py at the end of a real xAI sessionOpen formatter_v0.py — your Day 1 version. Compare it to formatter_v3.py. In four days you went from three hard-coded print statements to a tool that takes real input, does production math, formats output, and saves a file. That's the pace of this course. Week 2 is where the real power starts.