Let's say that I have the following code:
possibilities = range(20)
input_name = 4
for i in possibilities:
exec("import Function_" + str(i))
exec("Function_" + str(i) + ".solveproblem(" + str(input_name) + ")")
Since the second exec function, e.g. Function_3.solveproblem(4), can take infinity amount of time, I would just like to try (the function also can have some error) at most for 1,000 seconds and if the time exceeds, then I would like to stop that execution and go through the next function from another python file.
Any idea?