Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
json problem
#8
Seems doesn't work too :/
In this case:

#!/usr/bin/env python3

import json
import sys
with open('/tmp/config1.json') as json_file1:
    data = json.load(json_file1)
    for key in data:
        print(key)
Result is:

Output:
python3.7 script.py domaine
In my case what is interesting for me is: " To pull the key/value pair from a dictionary you need to use the dictionary_name.items()" Because, for the moment, here I need to retreive nom.
But next, in my script I will need other informations.

I continue to search but for the moment no success .. :(
Reply


Messages In This Thread
json problem - by enigma619 - Dec-18-2019, 04:45 PM
RE: json problem - by Clunk_Head - Dec-18-2019, 05:09 PM
RE: json problem - by ndc85430 - Dec-18-2019, 05:37 PM
RE: json problem - by enigma619 - Dec-18-2019, 06:34 PM
RE: json problem - by Clunk_Head - Dec-18-2019, 08:03 PM
RE: json problem - by enigma619 - Dec-18-2019, 09:29 PM
RE: json problem - by Clunk_Head - Dec-18-2019, 09:46 PM
RE: json problem - by enigma619 - Dec-19-2019, 07:13 AM
RE: json problem - by buran - Dec-19-2019, 08:11 AM
RE: json problem - by enigma619 - Dec-19-2019, 08:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with nested JSON Kalet 7 2,846 Dec-09-2021, 11:13 PM
Last Post: Gribouillis
  Problem with Json Array kwekey 2 1,716 Aug-02-2021, 05:11 PM
Last Post: kwekey
  Problem to parse a json enigma619 3 2,425 Dec-04-2020, 08:16 AM
Last Post: enigma619
  Output to a json file problem Netcode 3 3,795 Nov-22-2019, 01:44 AM
Last Post: Skaperen
  json load problem mepyyeti 6 5,000 Dec-28-2017, 02:15 AM
Last Post: Larz60+
  Python .json problem with UTF-8 file PickyBiker 5 12,858 Dec-28-2016, 04:56 PM
Last Post: PickyBiker

Forum Jump:

User Panel Messages

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