本文整理汇总了Python中fife.extensions.serializers.simplexml.SimpleXMLSerializer._serializeDict方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleXMLSerializer._serializeDict方法的具体用法?Python SimpleXMLSerializer._serializeDict怎么用?Python SimpleXMLSerializer._serializeDict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fife.extensions.serializers.simplexml.SimpleXMLSerializer
的用法示例。
在下文中一共展示了SimpleXMLSerializer._serializeDict方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: raw_input
# 需要导入模块: from fife.extensions.serializers.simplexml import SimpleXMLSerializer [as 别名]
# 或者: from fife.extensions.serializers.simplexml.SimpleXMLSerializer import _serializeDict [as 别名]
if os.path.isdir(fife_path) and fife_path not in sys.path:
sys.path.insert(0,fife_path)
# Load the XML Serialiser:
from fife.extensions.serializers.simplexml import SimpleXMLSerializer
print """ ____ _ ____ _____ _ ____ _ ____ _____
| _) \| |/ (__`|_ _|| || ===|| || ===|| () )
|____/|_|\____) |_| |_||__| |_||____||_|\_\
Python Dict to FIFE XML Serial Format Converter
"""
filename = raw_input("XML Filename: ")
xml = SimpleXMLSerializer(filename)
dict = {}
loop = True
while loop:
key = raw_input("Key: ")
dict[key] = raw_input("Value: ")
print "Add more? Y/n"
if raw_input() == "n":
loop = False
dictstore = xml._serializeDict(dict)
xml.set(raw_input("Module: "), raw_input("Name: "), dictstore)
xml.save(filename)
print filename + " has been updated with the new dict entry. Press enter to end this python shell"
raw_input()