Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: python write a list to a file line by line 
Python :: hcf program in python 
Python :: python detect keypress 
Python :: binary to text python 
Python :: python show image opencv 
Python :: python get num classes from label encoder 
Python :: remainder identifying python 
Python :: python Split a file path into root and extension 
Python :: how to say someting in python 
Python :: variable inside class not detecting global variable in python 
Python :: python f string columns 
Python :: draw pixel by pixel python 
Python :: python join list with comma 
Python :: sns scatter plot 
Python :: how to convert async function to sync function in python 
Python :: uninstall python from mac 
Python :: rezing images of entire dataset in python 
Python :: apolatrix 
Python :: how to calculate average in list python by using whil loop 
Python :: how to change python version on linux 
Python :: How to decrease length of entry in tkinter 
Python :: python temp directory 
Python :: pythons os module choose random file 
Python :: python dir all files 
Python :: import py to exe 
Python :: ImportError: No module named _tkinter, please install the python-tk package 
Python :: torch concat matrix 
Python :: how to python hack 2021 course 
Python :: print underline text python 
Python :: discord python command alias 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =