python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
how to add surrounding comments to an element in a list
fruits = CommentedSeq()
fruits.append('banana')
fruits.yaml_set_comment_before_after_key(0, 'comments above', after='comments below')
yaml.dump({'fruits': fruits}, sys.stdout)
I'd like the output to ...
Nowibananatzki
Votes: 0
Answers: 1
Updating a YAML file in Python
I am updating the following template.yaml file in Python3:
alpha:
alpha_1:
alpha_2:
beta:
beta_1:
beta_2:
- beta_2a:
beta_2b:
gamma:
Using ruamel.py I am able to fill the bl...
Mik Kim
Votes: 0
Answers: 1
Python creating dynamic YAML file using jinja2 for nested structures
I need to create a YAML file that is based on simple YAML that needs to be updated based on properties supplied by developers and contain the following YAML structure:
- switch: null
title: switch
...
Eyal Goren
Votes: 0
Answers: 1
ruamel.yaml: How to preserve structure of dict in YAML
I am using ruamel.yaml to edit YAML files and dump them. I need help on how to keep the structure the same as the original file,
I have a YAML file which has the content below, however, this content ...
mskm
Votes: 0
Answers: 2