[b]"What's the best way to python read json file into dict? Need help!"[/b] or [b]"How do I python read json file

20 Replies, 540 Views

Sometimes the JSON file has BOM (Byte Order Mark) which messes things up.

Try opening with:
```python
with open('data.json', 'r', encoding='utf-8-sig') as f:
data = json.load(f)
```
The `-sig` handles BOM. Saved me once!



Users browsing this thread: 1 Guest(s)