fdict= {0: fun1(), 1: fun2()}
# approach 1 : working fine, printing string
print fdict[random.randint(0,1)]
# approach 2 calling
thread.start_new_thread(fdict[random.randint(0,1)],())
#I also tried following approach
fdict= {0: fun1, 1: fun2}
thread.start_new_thread(fdict[random.randint(0,1)](),())
fun1 and fun2 are returning strings. I am able to call these functions using approach 1 but not able to call using approach 2. Getting error as shown below. But approach 1 already proved that these are callable.
thread.start_new_thread(fdict[random.randint(0,1)],())
TypeError: first arg must be callable