Created
February 2, 2014 14:09
-
-
Save aodag/8768998 to your computer and use it in GitHub Desktop.
asyncio + tornado.web python3.3以上で実行できます
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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