私はPythonに比較的慣れておらず、xml.domを使用してノードの子をループするのに問題があります。私はこれをしたい:
dom = parse("synth_options.xml")
root = dom.documentElement
child_nodes = root.childNode
for index, node in child_nodes:
#do stuff with index and node
ただし、次のエラーが表示されます。
Traceback (most recent call last):
File "synth.py", line 142, in <module>
for index, node in child_nodes:
TypeError: iteration over non-sequence
奇妙なことに、これは機能します:
for node in child_nodes:
#do stuff with index and node
役立つ場合はさらにコードを投稿できますが、他に関連するものはないと思います。前もって感謝します。