id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc
167,Please help saving dict to yaml,anonymous,xi,"{{{
Hi, is there any way of saving dict to a file in yaml format? I'm using:
----------------------------------------
#!/usr/bin/python
import yaml
y = """"""
    root:
         - subject1:
            desc: msg1
         - subject2:
            desc: msg2
""""""
settings=yaml.load(y)

settings['root'][0]['subject1']['desc'] = ""new msg""
print settings

f = open(""temp"", ""w"")
f.write(str(settings))
----------------------------------------
but failing miserably, contents of the temp file:
{'root': [{'subject1': {'desc': 'new msg'}}, {'subject2': {'desc': 'msg2'}}]}

expected result:
    root:
         - subject1:
            desc: new msg
         - subject2:
            desc: msg2

Is there anything like yaml.save? Any help greatly appreciated!

Regards,
Tomas
}}}",defect,closed,normal,pyyaml,normal,worksforme,,
