Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parse JSON multiple objects
#9
@pythonlearner1 - yes type will tell you just that, the type of the "data", but that will not tell you if the contents of the data is valid (and hence my suggestion to use a json validator if unsure first), in the case of the original posting, the variables the developer used can be tested as you say, but when the json he is reading is dumped into that variable it will just tell him the variable is of type "dict" or "list" or "str" for example, it wont tell him that the json is valid json necessarily, or that its presentation is without escape characters (encoding) depending on the method chosen or the package used - (there are a plethora of json parsers and validator packages in python), also the user was trying to iterate over a list in his second piece of code using a "dictionary" style "keywords", whereas a List requires indexes or an index range for splicing.
Regards
-------- *
“Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read.”
Reply


Messages In This Thread
Parse JSON multiple objects - by larkin_L - May-26-2020, 12:54 PM
RE: Parse JSON multiple objects - by pyzyx3qwerty - May-26-2020, 01:04 PM
RE: Parse JSON multiple objects - by larkin_L - May-26-2020, 01:46 PM
RE: Parse JSON multiple objects - by buran - May-26-2020, 01:53 PM
RE: Parse JSON multiple objects - by larkin_L - May-26-2020, 02:03 PM
RE: Parse JSON multiple objects - by buran - May-26-2020, 02:15 PM
RE: Parse JSON multiple objects - by nuffink - May-26-2020, 02:27 PM
RE: Parse JSON multiple objects - by pythonlearner1 - May-26-2020, 08:37 PM
RE: Parse JSON multiple objects - by nuffink - May-27-2020, 11:18 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to generating multiple json files using python script dzgn989 4 341 May-10-2024, 03:09 PM
Last Post: deanhystad
  parse json field from csv file lebossejames 4 878 Nov-14-2023, 11:34 PM
Last Post: snippsat
  [split] Parse Nested JSON String in Python mmm07 4 1,660 Mar-28-2023, 06:07 PM
Last Post: snippsat
  Trying to parse only 3 key values from json file cubangt 8 3,691 Jul-16-2022, 02:05 PM
Last Post: deanhystad
  geojson to json --missing multiple row output yoshi 9 3,024 Mar-06-2022, 08:34 PM
Last Post: snippsat
  Problem to parse a json enigma619 3 2,463 Dec-04-2020, 08:16 AM
Last Post: enigma619
  How to parse JSON DIC? ogautier 4 2,329 Sep-15-2020, 06:03 PM
Last Post: ogautier
  Looking for help in Parse multiple XMLs and update key node values and generate Out.. rajesh3383 0 1,924 Sep-15-2020, 01:42 PM
Last Post: rajesh3383
  How can i parse a log file to JSON. menarcarlos 2 2,505 May-26-2020, 10:23 AM
Last Post: buran
  print python json dump onto multiple lines lhailey 2 20,196 Mar-02-2020, 12:47 PM
Last Post: vishalhule

Forum Jump:

User Panel Messages

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