Skip to content

Instantly share code, notes, and snippets.

@ryunhe
Last active December 17, 2015 21:39
Show Gist options
  • Save ryunhe/5676357 to your computer and use it in GitHub Desktop.
Save ryunhe/5676357 to your computer and use it in GitHub Desktop.
# Usage:
#
# $ tornado.options.py -port=7777
# listen: 7777
#
# $ tornado.options.py -help
# --port Run on the given port (default 8888)
from tornado.options import define, options, parse_command_line
define("port", default=8888, help="Run on the given port", type=int)
def main():
parse_command_line()
print options.port
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment