outfile = xml.dom.minidom.Document() #create the xml file
list = outfile.createElement("List")#create the list that is the root
outfile.appendChild(list) #of the file
randomDict = {'asdf':6,'qewrty':42}
for entry in randomDict.items():
indentifier = outfile.createElement(entry[0])
list.appendChild(identifier)
answer = outfile.createElement(entry[1])
identifier.appendChild(answer)
print outfile.toxml()
Any ideas or suggestions would be helpful. Thanks!

New Topic/Question
Reply




MultiQuote




|