2013-04-06, 01:19
Hi,
I want to output all elements in a list into a window.
Here an example code:
I thought that converting i to a string would suffice, however with this example i also get:
"Error Contents: argument "label" for method "setLabel" must be unicode or str"
I think i have to use "return" in the function to achive my goal, any hints on how to do that with lists
and not receiving the "must be unicode or str" error?
Thanks in advance,
I want to output all elements in a list into a window.
Here an example code:
PHP Code:
#!/usr/bin/env python
import xbmc, xbmcgui
import sys
import data
ACTION_PREVIOUS_MENU = 10
array = ["2", "54", "045", "45", "5435"]
class MyClass(xbmcgui.Window):
def __init__(self):
self.strAction = xbmcgui.ControlLabel(400, 250, 200, 200, '', 'font30',)
self.addControl(self.strAction)
self.strAction.setLabel(computeInput())
def computeInput():
for i in array:
print(str(i))
mydisplay = MyClass()
mydisplay .doModal()
del mydisplay
I thought that converting i to a string would suffice, however with this example i also get:
"Error Contents: argument "label" for method "setLabel" must be unicode or str"
I think i have to use "return" in the function to achive my goal, any hints on how to do that with lists
and not receiving the "must be unicode or str" error?
Thanks in advance,