需要在stop_program函数中加入论坛打分线程的停止代码,修改位置如下:

def stop_program(self): self.running = False self.paused = False if self.score_thread and self.score_thread.is_alive(): self.score_thread.stop() if self.forum_thread and self.forum_thread.is_alive(): self.forum_thread.stop() self.start_button.config(state='normal') self.start_score_button.config(state='disabled') self.start_score_button_2.config(state='disabled') self.stop_score_button.config(state='disabled') self.pause_button.config(state='disabled') self.update_running_label('已停止运行')

Python Selenium 自动评分机器人代码改进 - 论坛打分停止功能

原文地址: https://www.cveoy.top/t/topic/f2i9 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录