Skip to content

Instantly share code, notes, and snippets.

@mikitebeka
Created August 17, 2010 15:10
Show Gist options
  • Select an option

  • Save mikitebeka/530321 to your computer and use it in GitHub Desktop.

Select an option

Save mikitebeka/530321 to your computer and use it in GitHub Desktop.
from collections import deque
from cherrypy import expose
stdout = deque()
def log(message):
stdout.append(message)
class WebServer:
@expose
def stdout(self, **kw):
lines = []
while stdout:
lines.append(stdout.popleft())
return "".join(lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment