Tulis file yaml tanpa menghapus konten

f = open('file_dir', 'a') #'a' means append  
f.write(variable)
Famous Flatworm