def stop(self):
"""Stop the running thread gracefully."""
print("Stopping thread...")
self.keep_running = False
# Wait for the thread to stop
self.wait()
print("Thread stopped")
# Uninitialize at thread stop (used for WMI in thread)
pythoncom.CoUninitialize()
评论列表
文章目录