这是一个功能强大的聊天中心,提供各种信息。
king-chat的Python项目详细描述
特大号聊天
这是一个功能强大的聊天中心,提供各种信息。
设计原则
- JSON输入,JSON输出
安装
git clone https://github.com/yingshaoxo/king-chat.git
cd king-chat
sudo -H python3 setup.py sdist
cd dist
sudo pip3 install * --upgrade
用法
git clone https://github.com/yingshaoxo/king-chat.git cd king-chat sudo -H python3 setup.py sdist cd dist sudo pip3 install * --upgrade
用法
服务器
fromking_chatimportServerserver=Server(ip="127.0.0.1",port=5920)@server.on_receiveddefhandle(protocol,text)protocol.send_to_all_except_sender(text)server.start(wait=True)
客户
fromking_chatimportClientclient=Client(name="qq",ip="127.0.0.1",port=5920)@client.on_receiveddefon_received(protocol,text):print(text)client.start(wait=False)while1:client.send(input('words: '))