GPT 5 Coding

Mini starter: Use GPT 5 Coding from Python (example)

This is a short copy pasteable pattern you can use to ask GPT5 to generate a simple to do app. Replace the YOUR API KEY and the prompt with your own.

from openai import OpenAI

client= OpenAI(api_key=”YOUR_API_KEY”) # or rely on env var

prompt = “””
Create a single-file HTML + JS to-do list app.
Requirements:
– Add, remove, mark-as-done items
– Save items to localStorage
– Mobile-friendly layout
– Include comments explaining key parts
Return the full file contents and nothing else.
“””

resp = client.chat.completions.create(
model=”gpt-5″,
messages=[{“role”: “user”, “content”: prompt}],
max_tokens=1500
)

print(resp.choices[0].message.content)

Notes:

Swap model=”gpt-5″ for whatever variant you have access to.

Use smaller, iterative prompts (generate scaffold → iterate → add features) for best results.

Leave a Comment