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
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) = True
config = {'global': {'server.socket_host': '', 'server.socket_port': int(sys.argv[1])}}
cherrypy.quickstart(Root(), config=config)
Something went wrong with that request. Please try again.