I've been using threading class alot in my Python codes and have successfully make a couple routine to run as multi-threaded. The problem is when something fails, it becomes a pain when it comes to debugging. This is what my code block would look like:
threads = []
for argument in get_file_method():
thread = threading.Thread(self._routine, argument)
thread.start()
threads.append(thread)
# Wait for all threads to complete
for thread in threads:
filename = thread.join()
The question is, How can I force the program to run as single threaded in order to ease debug.