Skip to content

Instantly share code, notes, and snippets.

@aodag
Created February 2, 2014 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aodag/8768998 to your computer and use it in GitHub Desktop.
Save aodag/8768998 to your computer and use it in GitHub Desktop.
asyncio + tornado.web python3.3以上で実行できます
import tornado.web
from tornado.platform.asyncio import AsyncIOMainLoop
import asyncio
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello")
AsyncIOMainLoop().install()
application = tornado.web.Application([
(r"/", MainHandler),
])
application.listen(8888)
asyncio.get_event_loop().run_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment