Python Forum
parse json output to simple text or variable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
parse json output to simple text or variable
#2
This is just mental exercise about how to extract data using indices and keys:

data = { 
... "Not matched": [], 
... "Matched": [ 
... [ 
... "anil1_kZJfP0k.JPG", 
... { 
... "Matching Percentage": "68.59" 
... } 
... ] 
... ] 
... } 
>>> f'response = {data["Matched"][0][0]}'
'response = anil1_kZJfP0k.JPG'
>>> f'matching percentage = {data["Matched"][0][1]["Matching Percentage"]}'
'matching percentage = 68.59'  
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: parse json output to simple text or variable - by perfringo - Jun-25-2019, 02:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Parse Nested JSON String in Python rwalde 4 2,974 Sep-08-2022, 10:32 AM
Last Post: rwalde
Information Parssing Json.dump from PYTHON to PHP for output on browser jodqueshiva 1 2,430 Nov-01-2021, 02:34 PM
Last Post: snippsat
  Predicting an output variable with sklearn Ccross1 1 2,537 Jun-04-2019, 03:11 PM
Last Post: michalmonday
  Simple pendulum with variable length Gaelou 1 3,394 Aug-30-2018, 04:32 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020