From 089c07689fe67300354ca0b8377e0b76866edace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E4=B8=96=E9=BE=99?= Date: Fri, 21 Oct 2016 16:06:16 +0800 Subject: [PATCH] use thread instead of multiprocessing in window system --- weixin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/weixin.py b/weixin.py index 240a7f0..714d7b1 100755 --- a/weixin.py +++ b/weixin.py @@ -958,8 +958,12 @@ class WebWeixin(object): print '[*] 自动回复模式 ... 关闭' logging.debug('[*] 自动回复模式 ... 关闭') - listenProcess = multiprocessing.Process(target=self.listenMsgMode) - listenProcess.start() + if sys.platform.startswith('win'): + import thread + thread.start_new_thread(self.listenMsgMode()) + else: + listenProcess = multiprocessing.Process(target=self.listenMsgMode) + listenProcess.start() while True: text = raw_input('')