ElementTree as ET tree = ET.parse('sample.xml') root=tree.getroot() element = root[0] #get ... #set the attribute to xml element element.text="string_text".
確定! 回上一頁