Dec-04-2018, 04:38 PM
Yeah I figured, typing without example is bs, sorry for that. Let me try again.
#inputlist comes from another program which could either be a single list like inputlist_a or like inputlist_b BUT could also be a presented with nested lists like inputlist_c inputlist_a = ["sheet1", "sheet2", "sheet3"] inputlist_b = ["sheet124", "sheet1233", "sheet12373"] inputlist_c = [a, b] #since I don't know the input I'm going to name this INPUT if isinstance(INPUT, list): for i in INPUT: if isinstance(i, list) for j in i: domyfunction(j) else domyfunction(i) #so in case of inputlist_a: #domyfunction loops sheet1, sheet2, sheet3 #so in case of inputlist_b: #domyfunction loops sheet124, sheet1233, sheet12373 #so in case of inputlist_c: #domyfunction loops sheet1, sheet2, sheet3 THEN sheet124, sheet1233, sheet12373