PDA

View Full Version : List in Python



56Killer
May 16th, 2009, 11:39 AM
Is there any way I could turn a string list made in python into a list in Boxee for use in a list or panel container. If anyone wants I could paste the code that generates the list.

Edit: I found how to do it.
All I had to do was add this.


items = mc.ListItems()
for line in string-list-name:
item = mc.ListItem(mc.ListItem.MEDIA_VIDEO_CLIP)
item.SetLabel(line)
items.append(item)
mc.GetWindow(windowid).GetList(listid).SetItems(it ems)

riegersn
June 20th, 2009, 11:25 AM
Not sure I completely follow you but...

in python:


stringlist = "title1, title2, title3"
stringlist = stringlist.split(", ")

items = mc.ListItems()

for title in stringlist:
item.SetLabel(line)
items.append(item)

mc.GetWindow(14000).GetList(listid).SetItems(items )