Assuming I'm creating some yaml file in python
import yaml
with open('myfile.yaml', 'w') as f:
yaml.dump({'k': 3.14, 'extra_long_key': 42}, f)
which results in
extra_long_key: 42
k: 3.14
However, I would like to change this to
extra_long_key: 42
k: 3.14
Is there any way to do this?