File size: 562 Bytes
d517dc9 | 1 2 3 4 5 | {"type": "session", "harness": "deepseek-harness", "id": "misc-0017-p2", "name": "JSON parsing in Python part 2"}
{"type": "message", "message": {"role": "system", "content": "You are a helpful Python tutor."}}
{"type": "message", "message": {"role": "user", "content": "How do I handle FileNotFoundError when reading JSON in Python?"}}
{"type": "message", "message": {"role": "assistant", "content": "```\nimport json\n\ntry:\n with open(\"data.json\") as f:\n data = json.load(f)\nexcept FileNotFoundError:\n print(\"File not found\")\n```"}}
|