Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import yaml
def write_yaml_to_file(py_obj, filename):
with open(f'{filename}.yaml', 'w',) as f:
yaml.dump(py_obj, f, sort_keys=False)
print('Written to file successfully')
def read_yaml_from_file(filename):
with open(f'{filename}.yaml') as f:
# py_obj = yaml.safe_load(f)
py_obj = yaml.load(f, Loader=yaml.Loader)
print('Read from file successfully')
return py_obj