Мне нужно исключить элемент из списка в цикле for и обновить xml-файл, выполнив поиск по этому исключенному элементу.
ниже находится мой xml-файл run.xml
<stm>
<id>ignore</id>
<ari>dv</rid>
<session>test</session>
</stm>
У меня есть список test = ['dv', 'ab', 'abc']
for i in test:
print i
"here I need to exclude the current element(i) from the list(test)"
"so the list will become for the first loop ['ab', 'abc']"
"assign excluded list to variable"
"next I need to search for current element(i) in the given xml file if found, update the next line 'test' with the 'temp'"
Я гуглил его, но не нашел связанных решений
после обновления файла XML вывод должен выглядеть как
<stm>
<id>ignore</id>
<ari>dv</rid>
<session>temp</session>
</stm>