且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在python中简单地连续运行XMPP客户端

更新时间:2022-06-15 22:36:42

主页上有一个很好的例子> xmpppy 本身(这是 python-xmpp 的另一个名称),它几乎可以满足您的需求:xtalk.py

There is a good example on the homepage of xmpppy itself (which is another name for python-xmpp), which does almost what you want: xtalk.py

它基本上是一个控制台 jabber 客户端,但应该不难将其重写为您想要的机器人.

It is basically a console jabber-client, but shouldn't be hard to rewrite into bot you want.

它始终在线,可以发送和接收消息.我认为这里不需要多处理(或其他并发)模块,除非您需要完全同时接收和发送消息.

It's always online and can send and receive messages. I don't see a need for multiprocessing (or other concurrency) module here, unless you need to receive and send messages at exact same time.