I use PyYAML to output a python dictionary to YAML format:

import yaml
d = { 'bar': { 'foo': 'hello', 'supercalifragilisticexpialidocious': 'world' } }
print yaml.dump(d, default_flow_style=False)

The output is:

bar:
  foo: hello
  supercalifragilisticexpialidocious: world

But I would like:

bar:
  foo                                : hello
  supercalifragilisticexpialidocious : world

Is there a simple solution to that problem, even a suboptimal one?

Edit
Report