itchat 动态注册

动态注册时可以选择将itchat.run()放入另一线程或使用configured_reply()方法处理消息。

两种方法分别是:

# 使用另一线程,但注意不要让程序运行终止
import thread

thread.start_new_thread(itchat.run, ())

# 使用configured_reply方法
while 1:
    itchat.configured_reply()
    # some other functions
    time.sleep(1)
posted @ 2018-02-23 10:00  欧阳平  阅读(377)  评论(0编辑  收藏  举报