私は特定のインターフェースのモデルタイプを変更したいXML文字列を持っています。xmlをPythonで修正するのに助けが必要
<domain type='kvm'>
<devices>
<interface type='network'>
<mac address='52:54:00:a8:fe:3d'/>
<source network='ovirtmgmt'/>
<model type='virtio'/>
</interface>
<interface type='network'>
<mac address='52:54:00:a8:fe:7d'/>
<source network='nat'/>
<model type='virtio'/>
</interface>
<interface type='network'>
<mac address='52:80:00:a8:66:20'/>
<source network='vm'/>
<model type='virtio'/>
</interface>
</devices>
</domain>
は今、私はソースnetwork='nat'
モデルtype='e1000'
を変更したいです。どうやってやるの?
:// docs.python.org/3 /ライブラリ/ xml.etree.elementtree.html' –
[lxmlの]あなたは1回の呼び出しでそれを行うことができます(http://lxml.de/)は別のお気に入りです。 – wwii