Advertisement
Mushi

Read XML and to append to list

Nov 19th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. import xml.etree.ElementTree as ET
  2. tree = ET.parse('testando.xml')
  3. root = tree.getroot()
  4.  
  5. lista = []
  6.  
  7. for row in root.iter('Row'):
  8.     a = row.attrib.get('A')
  9.     b = row.attrib.get('B')
  10.     c = row.attrib.get('C')
  11.     lista.append([a,b,c])
  12.  
  13. print(lista)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement