Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 18 lines (15 sloc) 597 Bytes
import sys
import cherrypy
from cherrypy.process.plugins import Daemonizer
Daemonizer(cherrypy.engine).subscribe()
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters import HtmlFormatter
class Root:
def pygments(self, lang, code):
lexer = get_lexer_by_name(lang)
formatter = HtmlFormatter()
return highlight(code, lexer, formatter)
pygments.exposed = True
config = {'global': {'server.socket_host': '0.0.0.0', 'server.socket_port': int(sys.argv[1])}}
cherrypy.quickstart(Root(), config=config)
Something went wrong with that request. Please try again.