LINUX.ORG.RU

История изменений

Исправление z00ke, (текущая версия) :

from xml.dom.minidom import *

xml_file = parse('lalala.xml')
sample_list = xml_file.getElementsByTagName('Sample') 

result = [float(sample.attributes['Value'].value) for sample in sample_list]

Исправление z00ke, :

from xml.dom.minidom import *

xml_file = parse('lalala.xml')
sample_list = xml_file.getElementsByTagName('Sample') 

for sample in sample_list :
    print(float(sample.attributes['Value'].value))

Исходная версия z00ke, :

from xml.dom.minidom import *

xml = parse('lalala.xml')
sample_list = xml.getElementsByTagName('Sample') 

for sample in sample_list :
    print(float(sample.attributes['Value'].value))