I have been trying to fix this problem but I cannot. I have the following code:
import json
def jsonblock(filename):
my_array = []
with open(filename) as f:
for line in f:
my_array.append(line)
p = " ".join(str(x) for x in my_array)
return p;
for i in jsonblock('P5.json'):
print(i)
and my P5.json is
{
"signalPassed" : true,
"location" : {
"longitude" : 113.3910083760899,
"latitude" : 22.57224988908558
},
"phoneOsVersion" : "7.0.3",
"signalStdDev" : 4.139107,
"phoneModel" : "iPad",
}
I want a normal output in str format but when I do it, I get the following output:
"
7
.
0
.
3
"
,
"
s
i
g
n
a
l
S
t
d
D
e
v
"
:
4
.
1
3
9
1
0
7
,
}
Where is the problem? How can I fix this?