I have one txt file: resultJSON.txt
the data in the txt file is in JSON format.
{
"term": "dog",
"results": [{
"filename": "1.jpg",
"numberID": "D12"
}, {
"filename": "23.jpg",
"number": "E52"
}]
}
I would like to read the txt into python and parse the JSON.
How to read the txt???
Make sure the following code is in the same folder as resultJSON.txt:
import json
with open('resultJSON.txt') as f:
json_data = json.load(f)
Your data will be in json_data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With