诅咒就像终端包装,有彩色的字符串!
curtsies的Python项目详细描述
[![构建状态](https://travis-ci.org/bpython/curties.svg?branch=master)(https://travis ci.org/bpython/curties)
[![文档状态](https://readthedocs.org/projects/curties/badge/?最新版本](https://readthedocs.org/projects/curties/?徽章=最新)
![行屈膝礼徽标](http://ballingt.com/assets/curtiestitle.png)
curtiesis a python 2.7&;3.4+兼容库,用于与终端交互。
这就是使用(几乎所有功能)简化的方式:
``python
从未来导入unicode文本;方便python 2
从简化导入random
从简化导入fullscreenwindow,input,fsarray
从简化导入红色,粗体,绿色,On*BLUE,黄色BR/> BR/>打印(黄色(“通常打印,不是交替屏幕”)
以FultStudio窗口()为窗口:
带输入()作为输入程序生成器:
MSG=红色(OnthBLUE(BOLD)(BurnSurvied to Exchange))
A= FSARTAL(窗口高度,窗口宽度)< [0:1,0:MSG.List]=[MSG]
输入生成器中的c:
如果c='<;esc>;':
中断
elif c='<;空格>;':
a=fsarray(window.height,window.width)
否则:
s=repr(c.decode()
row=random.choice(range(window.height))
column=random.choice(range(window.width len(s))
color=random.choice([红、绿、蓝、黄])
a[行、列:列+len(s)=[颜色]
window.render_to_terminal(a)
```
将其粘贴到“something.py”文件中并试用!
安装:`pip install curties`
[文档](http://curties.readthedocs.org/en/latest/)
primer
----
[fmtstr](http://curties.readthedocs.org/en/latest/fmtstr.html)对象是格式为
颜色和样式的字符串,可在终端中使用[ansi escape]显示。序列](http://en.wikipedia.org/wiki/ansi_escape_code>;```.
(下面显示的导入语句已经过时)
![](http://i.imgur.com/7lfaxsz.png)
[fsarray](http://curties.readthedocs.org/en/latest/fsarray.html)对象包含多个这样的字符串
,每个格式化字符串位于其自己的行上,fsarray
对象可以相互叠加
,通过组合来构建由彩色字符和样式字符组成的复杂网格。
(下面显示的导入语句已经过时)
![](http://i.imgur.com/rvtrpv1.png)
这样的字符网格可以在备用屏幕模式下呈现给终端
(没有历史记录,如“vim”,`按[全屏窗口](http://curties.readthedocs.org/en/latest/window.html curties.window.fullscreenwindow)对象
或按[cursorawarewindow](http://curties.readthedocs.org/en/latest/window.html curties.window.cursorawarewindow)对象保留正常历史的屏幕。
用户键盘输入事件,如按向上箭头密钥由
[输入](http://curties.readthedocs.org/en/latest/input.html)对象检测。
[](http://i.imgur.com/aucb55b.png)
*[避免X的游戏](/examples/gameexample.py)
![](http://i.imgur.com/nv1rqd3.png)
*[bpython curties uses curties](http://ballingt.com/2013/12/21/bpython curties.html)
/>[![(http://i.imgur.com/r7rzibs.png)](http://www.youtube.com/watch?
>
*[更多示例](/示例)
关于
>
>
>
*[行礼文件](http://curtisies.readthedocs.org/en/latest/)
*为[bpython on curties[bpythonon curties[bpythonon curties[bpythonon curties[bpythonon curties[bpythonon curties[bpythonon curties[bpython.com/2013/12/21/bpythonon curtieson.bpythonon curtieson.html]而写的行礼信(http://ballington.com/2013/2012/12/21/bpythonon curtieson curties
如果你有问题就打开一个问题!
*多亏了大家的努力TOR!
*如果您只需要彩色字符串,请考虑其中一个[其他
库](http://curties.readthedocs.io/en/latest/fmtstr.html\fmtstr基本原理)!
[![文档状态](https://readthedocs.org/projects/curties/badge/?最新版本](https://readthedocs.org/projects/curties/?徽章=最新)
![行屈膝礼徽标](http://ballingt.com/assets/curtiestitle.png)
curtiesis a python 2.7&;3.4+兼容库,用于与终端交互。
这就是使用(几乎所有功能)简化的方式:
``python
从未来导入unicode文本;方便python 2
从简化导入random
从简化导入fullscreenwindow,input,fsarray
从简化导入红色,粗体,绿色,On*BLUE,黄色BR/> BR/>打印(黄色(“通常打印,不是交替屏幕”)
以FultStudio窗口()为窗口:
带输入()作为输入程序生成器:
MSG=红色(OnthBLUE(BOLD)(BurnSurvied to Exchange))
A= FSARTAL(窗口高度,窗口宽度)< [0:1,0:MSG.List]=[MSG]
输入生成器中的c:
如果c='<;esc>;':
中断
elif c='<;空格>;':
a=fsarray(window.height,window.width)
否则:
s=repr(c.decode()
row=random.choice(range(window.height))
column=random.choice(range(window.width len(s))
color=random.choice([红、绿、蓝、黄])
a[行、列:列+len(s)=[颜色]
window.render_to_terminal(a)
```
将其粘贴到“something.py”文件中并试用!
安装:`pip install curties`
[文档](http://curties.readthedocs.org/en/latest/)
primer
----
[fmtstr](http://curties.readthedocs.org/en/latest/fmtstr.html)对象是格式为
颜色和样式的字符串,可在终端中使用[ansi escape]显示。序列](http://en.wikipedia.org/wiki/ansi_escape_code>;```.
(下面显示的导入语句已经过时)
![](http://i.imgur.com/7lfaxsz.png)
[fsarray](http://curties.readthedocs.org/en/latest/fsarray.html)对象包含多个这样的字符串
,每个格式化字符串位于其自己的行上,fsarray
对象可以相互叠加
,通过组合来构建由彩色字符和样式字符组成的复杂网格。
(下面显示的导入语句已经过时)
![](http://i.imgur.com/rvtrpv1.png)
这样的字符网格可以在备用屏幕模式下呈现给终端
(没有历史记录,如“vim”,`按[全屏窗口](http://curties.readthedocs.org/en/latest/window.html curties.window.fullscreenwindow)对象
或按[cursorawarewindow](http://curties.readthedocs.org/en/latest/window.html curties.window.cursorawarewindow)对象保留正常历史的屏幕。
用户键盘输入事件,如按向上箭头密钥由
[输入](http://curties.readthedocs.org/en/latest/input.html)对象检测。
[](http://i.imgur.com/aucb55b.png)
*[避免X的游戏](/examples/gameexample.py)
![](http://i.imgur.com/nv1rqd3.png)
*[bpython curties uses curties](http://ballingt.com/2013/12/21/bpython curties.html)
/>[![(http://i.imgur.com/r7rzibs.png)](http://www.youtube.com/watch?
>
*[更多示例](/示例)
关于
>
>
>
*[行礼文件](http://curtisies.readthedocs.org/en/latest/)
*为[bpython on curties[bpythonon curties[bpythonon curties[bpythonon curties[bpythonon curties[bpythonon curties[bpythonon curties[bpython.com/2013/12/21/bpythonon curtieson.bpythonon curtieson.html]而写的行礼信(http://ballington.com/2013/2012/12/21/bpythonon curtieson curties
如果你有问题就打开一个问题!
*多亏了大家的努力TOR!
*如果您只需要彩色字符串,请考虑其中一个[其他
库](http://curties.readthedocs.io/en/latest/fmtstr.html\fmtstr基本原理)!