【发布时间】:2019-05-02 17:52:16
【问题描述】:
我有主应用程序,我可以用聊天机器人打开线程。
def run_bot(self):
bot = TelegramBot(self.engine.CurrentBot)
bot.start()
然后我要关闭我的应用程序,我需要销毁我所有的踏板。我在 PyCharm 中使用停止按钮。它返回KeyboardInterrupt,但不会杀死机器人。他们正在继续使用应用程序。
Telegram bot 是Thread 的子类
【问题讨论】:
标签: python python-3.x multithreading class thread-safety