在终端中实现聊天的小号打印工具
print-chat的Python项目详细描述
在终端中实现聊天的小号打印工具。在
https://pypi.org/project/print_chat/
使用示例
importprint_chataspcpct=pc.print_chat()sender='Charls'pct.set_colors([('Charls','green')])whileTrue:post=str(input('> '))ifpost=='exit':breakelse:pct.up_on_occupied_rows(len(post)+len(sender)+2)pct.add_message('Charls',post)pct.close()
用于测试主要功能:
^{pr2}$重要的
这不是一个bug这是一个特性
创建对象
默认值:
pct=print_chat.print_chat(time=False)
- 时间-显示消息发送时间
方法列表
- 。添加消息(发件人,文本,时间='',跳过=[],标记=[])
- 。添加“邮件”顶部(发件人,文本,时间=“”,跳过=[],标记=[],prnt=True)
- .重新加载(编号)
- .删除(数字)
- .edit(数字,文本)
- .add_skip(数字,文本)
- 。编辑跳过(数字,文本)
- .删除跳过(编号)
- .添加标记(数字、文本)
- .编辑标记(数字、文本)
- .删除标记(数字)
- .close(clr)-关闭对话框,无论是否清除屏幕
- .set_头(字符串)
- 。设置颜色(颜色)-获取列表[[发件人,颜色],…]
- 颜色列表:
- 灰色
- 红色
- 绿色
- 黄色
- 蓝色
- 洋红
- 青色
- 白色
- .get_num_messages()—返回消息数
- 。获取消息()
- 。获取来自(发件人)的消息
- .up_on_占用的_行(len_str)
- .up_on_消息(号码)
- .上排(数字)
- 。清除行()
- .u清除屏幕()
- .get_senders()-返回字典列表
安装
$ pip install print_chat
或
存储库克隆
$ git clone https://github.com/IVIGOR13/print_chat.git
调谐
$ pip install termcolor $ pip install colorama
- 项目
标签: