欧美人与性动交α欧美精品,边摸边吃奶做爽A片视频,亚洲精品动漫免费二区,刺激一区仑乱

Section Menu:  

xml轉(zhuǎn)字典函數(shù):xml_data()

  • 發(fā)布時間: 2020-03-31 14:45
  •    閱讀: 2907   

描述

xml_data() xml轉(zhuǎn)字典
xml_data() 接收一個參數(shù),第一個參數(shù)為要轉(zhuǎn)換的xml數(shù)據(jù)


語法

以下是 xml_data() 的語法:

xml_data(data)

參數(shù)

    ● data [類型]:需要轉(zhuǎn)字典的xml數(shù)據(jù)。


返回值

返回一個dict類型的數(shù)據(jù)


實例

以下展示了使用 xml_data() 的實例:

from kyger.common import xml_data
data = """
<xml>
  <ToUserName><![CDATA[toUser]]></ToUserName>
  <FromUserName><![CDATA[fromUser]]></FromUserName>
  <CreateTime>1348831860</CreateTime>
  <MsgType><![CDATA[text]]></MsgType>
  <Content><![CDATA[this is a test]]></Content>
  <MsgId>1234567890123456</MsgId>
</xml>"""
print(xml_data(data))

以上實例運行后輸出的結(jié)果為:

{'ToUserName': 'toUser', 'FromUserName': 'fromUser', 'CreateTime': 1348831860, 'MsgType': 'text', 'Content': 'this is a test', 'MsgId': 1234567890123456}

適應(yīng)版本

v1.0.1