I declared a variable which stores JSON file (output returned from subprocess).
app_data = self.run_subprocess(create_app)
Printed app_data looks like that:
(check comments for printed data)
I want to grab particular value from this str "appId", so I try to load app_data to json string and grab that value..
json_str = json.loads(app_data)
print(json_str["appId"])
Error
json.decoder.JSONDecodeError: Extra data: line 190 column 1 (char 5767)
-
newtextdocument.com/776fb7d21b output was too big to post it so check it heremike– mike2020年04月27日 16:40:22 +00:00Commented Apr 27, 2020 at 16:40
-
Cannot reproduce with the newtextdocument.com file: it loads without error.Serge Ballesta– Serge Ballesta2020年04月27日 16:43:12 +00:00Commented Apr 27, 2020 at 16:43
-
2I did json.loads on your post and it worked for me. json_str['appId'] returned '7f1f91c2-3b28-48ee-96ed-89080980'.Bobby Ocean– Bobby Ocean2020年04月27日 16:43:32 +00:00Commented Apr 27, 2020 at 16:43
-
@BobbyOcean so strange.. can you share you code?mike– mike2020年04月27日 16:46:19 +00:00Commented Apr 27, 2020 at 16:46
-
I simply copied your text in triple quotes x = """ """ and then ran import json, y = json.loads(x), and then y['appId'].Bobby Ocean– Bobby Ocean2020年04月27日 16:49:03 +00:00Commented Apr 27, 2020 at 16:49
1 Answer 1
It works fine upon running it and return the value 7f1f91c2-3b28-48ee-96ed-89080980. You can also confirm that it's a valid Json String by checking with a validator here.
The error
json.decoder.JSONDecodeError: Extra data: line 190 column 1 (char 5767)
I believe the error is to do with some malformed character on line 190, right after the line of the closing }. Find that and delete it and it should work fine