Skip to content

Instantly share code, notes, and snippets.

@damianesteban
Created September 2, 2013 06:45
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 damianesteban/6409851 to your computer and use it in GitHub Desktop.
Save damianesteban/6409851 to your computer and use it in GitHub Desktop.
#sudo apt-get install python-tornado
#there is an altertive as python3-tornado
#file below code into hello.py
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
application = tornado.web.Application([
(r"/", MainHandler),
])
if __name__ == "__main__":
application.listen(8888)
tornado.ioloop.IOLoop.instance().start()
#python hello.py
#curl <ip>:8888
#Hello, worldroot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment