诅咒变得简单
cursebox-lib的Python项目详细描述
诅咒变得简单
pip install cursebox-lib
cursebox是一个基于curses标准模块的库。其目标是避免curses的类似c的仪式,并提供一种现代的终端绘制方法:
>>>fromcurseboximport*>>>withCursebox()ascb:...width,height=cb.width,cb.height...greeting="Hello, World!"...# Center text on the screen...cb.put(x=(width-len(greeting))/2,...y=height/2,text=greeting,...fg=colors.black,bg=colors.white)...# Wait for any keypress...cb.poll_event()
它提供了几个有用的功能:
- 无安装/拆卸
- RGB转换为终端256色调色板
- 活动管理
待办事项
- 单元测试
- 完成文档
- 手工制作的
curses
模块,使用ANSI转义序列替换窗口 - 从其他项目添加像素缓冲区