<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import time


class ThreadMonitor:
    def __init__(self, threads):
        self.threads = threads

    def list_running_threads(self):
        while True:
            f = open("active_threads.txt", "w")
            f.close()
            for thread in self.threads:
                if thread.is_alive():
                    with open("active_threads.txt", "a") as f:
                        f.write(
                            f"Thread Name: {thread.name}, Alive: {thread.is_alive()}\n"
                        )
            time.sleep(5)
</pre></body></html>