added ex25
This commit is contained in:
parent
0461556e9f
commit
67ebc11121
8
ex_25.py
Normal file
8
ex_25.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
from defusedxml import ElementTree
|
||||
|
||||
|
||||
with open("python_class.xml") as fin:
|
||||
for i, node in enumerate(ElementTree.parse(fin).iter()):
|
||||
print(node.tag, ":", node.text)
|
||||
|
||||
|
1
python_class.xml
Normal file
1
python_class.xml
Normal file
|
@ -0,0 +1 @@
|
|||
<python_class><teacher><name>Stefano</name><age>unknown</age></teacher><student><name>Jonathan</name><age>19</age><matr_number>2572463</matr_number></student><student><name>Susan</name><age>21</age><matr_number>4172463</matr_number></student><student><name>Dennis</name><age>22</age><matr_number>4176963</matr_number></student></python_class>
|
Loading…
Reference in New Issue
Block a user