2025-09-10:仓库迁移

This commit is contained in:
2025-09-10 16:12:45 +08:00
parent e0e49b0ac9
commit 3130e336a1
146 changed files with 4066 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
from xml.etree.ElementTree import Element
def dict_to_xml(tag, d):
# 创建一个element实例
elem = Element(tag)
# 将字典键值对拆开填入
for k, v in d.items():
child = Element(k)
child.text = str(v)
elem.append(child)
return elem
if __name__ == '__main__':
s = {"name": 'GOOG',
"shares": 100,
"price": 490.1}
e = dict_to_xml("stock", s)
print(e)