将带有ANSI颜色代码的文本转换为HTML

ansi2html的Python项目详细描述


将带有ANSI颜色代码的文本转换为HTML或LaTex。

pixelbeatblackjack的作品中得到启发和发展。

生成状态

BranchStatus
masterBuild Status - master branch
developBuild Status - develop branch

示例-python api

>>> from ansi2html import Ansi2HTMLConverter
>>> conv = Ansi2HTMLConverter()
>>> ansi = "".join(sys.stdin.readlines())
>>> html = conv.convert(ansi)

示例-Shell用法

$ ls --color=always | ansi2html > directories.html
$ sudo tail /var/log/messages | ccze -A | ansi2html > logs.html
$ task rc._forcecolor:yes limit:0 burndown | ansi2html > burndown.html

查看完整选项列表:

$ ansi2html --help

获取此项目:

$ sudo yum install python-ansi2html

来源:http://github.com/ralphbean/ansi2html/

PYPI:http://pypi.python.org/pypi/ansi2html/

许可证

ansi2html已获得lgplv3+许可。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java调用Python函数作为TEID中的UDF   java Android。支持v4导入不工作   java如何影响具有静态属性的类   java如何在从glTexImage2D()分配后编辑纹理的像素颜色   javaspringboot+rediscache+@Cacheable适用于某些方法,而不适用于其他方法   java无法将动态Web模块方面从3.0更改为2.5   java如何在新选项卡中显示打印的文档?   java Google Cloud Endpoints API方法仅在删除用户参数时成功调用   java为什么我可以使用Stack<Double>但不能使用Stack<Double>?   java JDBC PreparedStatement似乎忽略了占位符   java如何设置JInternalFrame的标准图标化位置?   Java文件。copy()不复制文件   基于另一个类的java显示arraylist?   java Android Studio:错误:非法字符:'\u2028'   对象(Java)无法实例化类型映像?   javascript错误:飞行前响应的HTTP状态代码401无效   java确保泛型vararg参数具有相同的类型