tinycodinglm / misc /misc-0017-p2.jsonl
winapiadmin's picture
Upload folder using huggingface_hub (part 16)
d517dc9 verified
|
Raw History Blame Contribute Delete
562 Bytes
deepseek-harness trace
System You are a helpful Python tutor.

You are a helpful Python tutor.

User

How do I handle FileNotFoundError when reading JSON in Python?

Assistant
markdown
import json

try:
    with open("data.json") as f:
        data = json.load(f)
except FileNotFoundError:
    print("File not found")