Currently I'm trying to call a function with a different function that loops the initial function until a keystroke from myself. Here's the code I'm trying to run:
def input_thread(a_list):
raw_input()
a_list.append(True)
def loop_display(function):
a_list = []
thread.start_new_thread(input_thread, (a_list,))
while not a_list:
function
#print "next"
time.sleep(2)
loop_display(function)
The problem is that it only runs the called function once.
When I print something in the loop, it loops that print call, but the passed in function only once.
Ideally, I'd like to put this loop into another file and call it when needed. But that won't work if I can't call another function through it, correct?
I pulled the loop code from this answer.
Note: If it matters, the keystroke ending the function works fine.