摘要: Python 解析xml 1、获取xml树 import xml.etree.ElementTree as ET def getTree(xmlName): xmlName = xmlName.strip() try: tree = ET.parse(xmlName) except: tree = 阅读全文
posted @ 2020-09-11 17:05 南风丶轻语 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1.一维list a = [1, 2, 1, 3, 4, 5] b = ['a', 'b', 'a', 'c', 'd', 'b'] a.sort() b.sort() print a print b 结果 2.多维list (1)根据前两项排序 my_list = [['a', '2', '', 阅读全文
posted @ 2020-09-11 10:15 南风丶轻语 阅读(186) 评论(0) 推荐(0) 编辑