Created
November 23, 2020 14:29
-
-
Save lawvs/618da7cd16d16d57df2a6245f576625a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pygments import highlight as syntax_highlight | |
from pygments.formatters import img | |
from pygments.lexers import guess_lexer | |
lexer = guess_lexer(message) | |
formatter = img.JpgImageFormatter(style="colorful") | |
result = syntax_highlight(message, lexer, formatter, outfile=None) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment