Let's say I have a value callfunc in list list1 that I want to call on the next value in the list, but only if callfunc is in list2 (it is). I have this code:
for instr in list1:
if instr in list2:
eval(instr(list1[list1.index(instr)+1]))
And I get this error message:
eval(instr(list1[list1.index(instr)+1]))
TypeError: 'str' object is not callable
I'm trying to get the output as a function, not a string of:
callfunc(75)
That will, in the script, call callfunc on 75.
lists 1 and 2:
list1 = [callfunc, 75]
list2 = [callfunc]
I have no idea where to go from here. Help would be greatly appreciated.
callfunc is a string.