问题
I am looking for a python module that will let me generate "syntax highlighted" HTML code out of a code written in any of the popular languages.
Something similar to what stackoverflow does with the code tag.
回答1:
You probably want pygments.
It highlights most popular languages and outputs to HTML, RDF, LaTeX, and many more.
来源:https://stackoverflow.com/questions/11366983/convert-code-to-syntax-highlighted-html