我如何只使用一个python ListProperty Srings

时间:2017-07-22 08:08:26

标签: python kivy

我使用ListProperty并返回:

['\xce\xbb\xce\xb9\xce\xb1\xcf\x83\xcf\x84\xce\xae \xce\xbd\xcf\x84\xce\xbf\xce\xbc\xce\xac\xcf\x84\xce\xb1',
 '\xcf\x83\xce\xbf\xcf\x85\xcf\x83\xce\xac\xce\xbc\xce\xb9',
 '\xcf\x84\xcf\x85\xcf\x81\xce\xaf']

我想将它们放在一个ListItemLabel中,但它不会识别它们,因为它们位于list中。

1 个答案:

答案 0 :(得分:0)

您可以通过将字符串逐个传递给列表构建函数来将它们添加到列表中。要将它们添加到列表中,请创建一个循环并将它们逐个添加到列表视图中。

list1=['\xce\xbb\xce\xb9\xce\xb1\xcf\x83\xcf\x84\xce\xae \xce\xbd\xcf\x84\xce\xbf\xce\xbc\xce\xac\xcf\x84\xce\xb1', '\xcf\x83\xce\xbf\xcf\x85\xcf\x83\xce\xac\xce\xbc\xce\xb9', '\xcf\x84\xcf\x85\xcf\x81\xce\xaf']
for option in list:
    #your code for adding option to your listview