我想将多个值附加到此节点(如果有),但执行此操作时,productid2将替换productid1。是否有方法返回单独的产品id项目
for node in tree.xpath( '//map/topicmeta' ):
node.insert(5, othermeta)
othermeta.set("name", "product-id")
othermeta.attrib['content'] = meta_productid1
othermeta.set("name", "product-id")
othermeta.attrib['content'] = meta_productid2
您可以使用
list
或tuple
存储多个项目:或
您可以通过以下方式获得:
如果}合并为一个
othermeta.attrib['content']
的类型限制为str
,则可以将id1
{str
,并在使用以下内容的地方对其进行解析:商店:
使用:
希望我对你的问题没有误解
相关问题 更多 >
编程相关推荐