Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python write yaml

import yaml

dict_file = [{'sports' : ['soccer', 'football', 'basketball', 'cricket', 'hockey', 'table tennis']},
{'countries' : ['Pakistan', 'USA', 'India', 'China', 'Germany', 'France', 'Spain']}]

with open(r'E:datastore_file.yaml', 'w') as file:
    documents = yaml.dump(dict_file, file)
Source by stackabuse.com #
 
PREVIOUS NEXT
Tagged: #python #write #yaml
ADD COMMENT
Topic
Name
1+5 =