Examples using Python Tornado web server.
Runs on Python 3.2+
Each .py file is a standalone tornado web server example
Examples include:
- Asynchronous, non-blocking call to a URL to retrive JSON data
- Yield and co-routine
- Non overlapping periodic calls every N seconds to a URL. Stop after X retries.
- Overlapping periodic calls every N seconds to a URL. Stop after X retries.
$ python <file>.py 8888 # Specify a port
$ python <file>.py # Use default 3000 portClone the repo
$ git clone git@github.com:alyssaq/tornado-examples.gitInstall requirements or check that you have them installed with pip freeze:
$ pip install -r requirements.txtYou may install requirements into a virtualenv. I recommend using virtualenvwrapper:
$ mkvirtualenv tornadoenv
$ workon tornadoenv
$ pip install -r requirements.txt
$ deactivate # Stop virtualenv when you are done- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
MIT