Escreva o arquivo YAML sem excluir o conteúdo
f = open('file_dir', 'a') #'a' means append
f.write(variable)
Famous Flatworm
f = open('file_dir', 'a') #'a' means append
f.write(variable)