From the documentation:
print yaml.dump(a, default_flow_style=False)
The value can be True
, False
, or None
. If None
or unspecified (that is, the default), it chooses automatically whether to use inline or block-style output. False
never uses inline, True
is always inline.