You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
601 B
Python

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

from yaml import safe_load
from pprint import pprint
# loads database credentials in the globals config module
local_params_file = "maison.yaml"
with open(local_params_file, 'r') as file_handle:
params_content = safe_load(file_handle)
# pprint(params_content)
prince_code = dict()
for content in params_content:
prince_code[content[1]] = content[0]
import json
#pprint(prince_code)
sortie = "house_trigram.json"
with open(sortie, "w") as fp:
json.dump(prince_code, fp, sort_keys=True, indent=4)
entree = sortie
with open(entree, "r") as fp:
data = json.load(fp)
pprint(data)