#!/usr/bin/env python3 import json import sys import os with open('/tmp/config1.json') as json_file: data = json.load(json_file) for key, value in data.items(): print ("key:", key,) print ("value", value,)And result is:
Output:key: domaine
value {'nom': {'service': ['test']}}
My exact json is:Output:{
"domaine": {
"nom": {
"service": ["test"]
}
}
}
I've created a new python prog to be sure domaine and others are not already declared.Thanks