Skip to content
Snippets Groups Projects
Commit 76fe655f authored by Guido Sterbini's avatar Guido Sterbini
Browse files

Adding config_to_yaml

parent a7ccd1fa
No related branches found
No related tags found
2 merge requests!2Dev v0.0.1,!1Dev v0.0.1
Pipeline #2790221 passed
......@@ -11,7 +11,7 @@ from .general import tree_from_yaml
from .general import tree_from_json
from .general import from_yaml
from .general import from_json
from .general import py_to_yaml
from .general import config_to_yaml
from .tag import *
from .tag_json import *
......
......@@ -37,9 +37,9 @@ def from_json(filename, verbose=False):
if verbose: print(e)
return {}
def py_to_yaml(filename):
'''Convert the *filename*.py (containg dictionaries) to an
equivalent *filename*.yaml'''
import filename as my_dict
with open(filename+'.yaml', 'w') as fid:
yaml.dump(my_dict, fid)
def config_to_yaml():
'''Convert the config.py (containg dictionaries) to an
equivalent config.yaml'''
import config as my_dict
with open('config.yaml', 'w') as fid:
yaml.dump(my_dict.configuration, fid)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment