2
# -*- coding: utf-8 -*-
3
# Nom de fichier : script.py
6
import xml.etree.ElementTree as ET
8
fichierBeerXML = 'qbrew.xml'
10
arbre = ET.parse(fichierBeerXML)
12
presentation=arbre.find('.//RECIPE')
13
style=arbre.find('.//STYLE')
14
fermentables=arbre.findall('.//FERMENTABLE')
17
#Presentation de la recette
18
for nom in presentation :
19
if nom.tag == "NAME" :
23
if nom.tag == "NAME" :
24
StyleRecette = nom.text
26
for genre in presentation :
27
if genre.tag == "TYPE" :
28
GenreRecette = genre.text
31
nbreFer = len(fermentables)
36
for nom in fermentables[i] :
37
if nom.tag == 'NAME' :
39
if nom.tag =='COLOR' :
44
print('{0} : {1}°' .format(fNom,fColor))