是否有任何python模块采用文本并添加python语法高亮?(Are there any python modules that take text and add python syntax hi

编程入门 行业动态 更新时间:2024-10-28 12:26:24
是否有任何python模块采用文本并添加python语法高亮?(Are there any python modules that take text and add python syntax highlighting to it?)

是否有任何python模块,我可以使用谷歌应用程序引擎,采取如下代码串:

<pre> a = 1 while a < 10: print a a += 1 </pre>

然后像基本的python编辑器那样为文本着色(或者像堆栈溢出)?

这将突出显示预标签内的内容,并将在线显示。

Are there any python modules that I could use with google app engine that take a string of code like this:

<pre> a = 1 while a < 10: print a a += 1 </pre>

and then color the text like a basic python editor would (or like stack overflow)?

This would be highlighting the stuff inside the pre tag and would be displayed online.

最满意答案

你在寻找Pygments 。

[Pygments]是一种通用语法高亮显示器,适用于各种软件,如论坛系统,wiki或其他需要美化源代码的应用程序。

You're looking for Pygments.

[Pygments] is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code.

更多推荐

python,显示,<pre>,电脑培训,计算机培训,IT培训"/> <meta name="descrip

本文发布于:2023-07-24 00:13:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1239118.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:语法   模块   有任何   文本   python

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!