Simplificacion codigo
This commit is contained in:
parent
aef90d3456
commit
5e85d41142
1 changed files with 4 additions and 11 deletions
|
@ -7,21 +7,14 @@ from pygments.formatters.img import PilNotAvailable
|
|||
lenguaje = get_lexer_by_name("python", stripall=True)
|
||||
|
||||
trozo_codigo = """
|
||||
from pygments import highlight
|
||||
from pygments.lexers import get_lexer_by_name
|
||||
from pygments.formatters import ImageFormatter
|
||||
from pygments.formatters.img import PilNotAvailable
|
||||
|
||||
lenguaje = get_lexer_by_name("python", stripall=True)
|
||||
|
||||
trozo_codigo = ""\"
|
||||
...
|
||||
escribir aqui
|
||||
el código
|
||||
que se quiera
|
||||
generar como imagen
|
||||
...
|
||||
|
||||
""\"
|
||||
|
||||
img = highlight(trozo_codigo, lenguaje, ImageFormatter(style='material'), outfile="codigo.png")
|
||||
|
||||
"""
|
||||
|
||||
img = highlight(trozo_codigo, lenguaje, ImageFormatter(style='material'), outfile="codigo.png")
|
||||
|
|
Loading…
Reference in a new issue