I have a code with a loop that I need to skip an iteration if it is taking too much time.
Example:
list = ['a', 'b', 'c', ......]
for x in list:
#do something that takes time
In my code, the list has several paths. I loop through every path of that list to do some actions in files, but there are some files that take too long. I don't want the script to be stuck in a path for more than half an hour... If it takes more than 30 minutes while executing it, I want it to skip that path and go to the next on the list.