I tried to set a global variable in a funktion. global the variable is set to Kategorie = ''
In one of my function I would like to set it to a other value:
elif methode=='show_select_dialog': writeLog('Methode: show select dialog', level=xbmc.LOGDEBUG) dialog = xbmcgui.Dialog() cats = [__LS__(30120), __LS__(30121), __LS__(30122), __LS__(30123), __LS__(30116)] ret = dialog.select(__LS__(30011), cats) if ret == 6: refreshWidget() elif 0 <= ret <= 5: writeLog('%s selected' % (cats[ret]), level=xbmc.LOGDEBUG) global Kategorie Kategorie = (cats[ret]) refreshWidget() If I log the variable Kategorie in function refreshWidget the value is correct (cats[ret]), but after that if the function refreshedWidget is called again the value is gone...
elif methode == 'get_item_serienplaner': sp_items = refreshWidget() Once I have changed the variable to cats[ret] I would need it as cats[ret]
Kategorie