I am new to python but I have learned lots of stuff, but I found difficulty to read a JSON file. I need to read it in a way to access a particular data in this file. The file contain a data as follow:
[
29723,
5426523,
"this book need to be printed",
"http://amzn.to/U60TaF"
][
29723,
807242528,
"ready for shipping",
"http://nblo.gs/HNpn"
]
my code is:
FI = open(file_name, 'r')
for line in FI:
tweet = json.loads(line)
print(tweet)
The output is only the last line which is the link, I don't know way.
jsonto read it. You need to have a specification of the file, and then use a reader made for that. If it does not exist, you have to write you own. There is no "almost like a X" in programming. Computers are too precise for that.