我有我用xml编写的图像列表,我可以在xbmc上运行它们。在
以下是xml中的图像列表:
<?xml version="1.0" encoding="utf-8"?>
<window type="dialog">
<allowoverlay>no</allowoverlay>
<coordinates>
<system>1</system>
<posx>0</posx>
<posy>0</posy>
</coordinates>
<controls>
<control type="image" id="1">
<description>Image1</description>
<posx>307</posx>
<posy>7</posy>
<width>164</width>
<height>102</height>
<visible>true</visible>
<texturefocus>image1_blue.jpg</texturefocus>
<texturenofocus>image1_yellow.jpg</texturenofocus>
<onup>2</onup>
<ondown>3</ondown>
<onleft>1</onleft>
<onright>1</onright>
</control>
<control type="image" id="2">
<description>Image2</description>
<posx>471</posx>
<posy>7</posy>
<width>201</width>
<height>102</height>
<visible>true</visible>
<texturefocus>image2_yellow.jpg</texturefocus>
<texturenofocus>image2_blue.jpg</texturenofocus>
<onup>2</onup>
<ondown>3</ondown>
<onleft>1</onleft>
<onright>1</onright>
</control>
<control type="image" id="4">
<description>Image3</description>
<posx>671</posx>
<posy>7</posy>
<width>177</width>
<height>102</height>
<visible>true</visible>
<texturefocus>image3_yellow.jpg</texturefocus>
<texturenofocus>image3_blue.jpg</texturenofocus>
<onup>2</onup>
<ondown>3</ondown>
<onleft>1</onleft>
<onright>1</onright>
</control>
<control type="image" id="6">
<description>image4</description>
<posx>848</posx>
<posy>7</posy>
<width>176</width>
<height>102</height>
<visible>true</visible>
<texturefocus>image4_yellow.jpg</texturefocus>
<texturenofocus>image4_blue.jpg</texturenofocus>
<onup>2</onup>
<ondown>3</ondown>
<onleft>1</onleft>
<onright>1</onright>
</control>
</controls>
</window>
我想知道你如何在python中为xbmc编写if语句,如果图像包含id,那么我想知道如何使用id更改图像?在
Python附带了
xml
模块,该模块具有有用的ElementTree
,可以满足您的需要。在下面是一个如何使用它的示例:
进一步阅读:^{} documentation 。在
相关问题 更多 >
编程相关推荐