Skip to content

Instantly share code, notes, and snippets.

@xiantail
Created December 25, 2015 05:45
Show Gist options
  • Save xiantail/a46110c9821f20956701 to your computer and use it in GitHub Desktop.
Save xiantail/a46110c9821f20956701 to your computer and use it in GitHub Desktop.
Introducing Python / Chapter 9
from bottle import route, run, static_file
@route('/')
def main():
return static_file('index.html', root='.')
@route('/echo/<thing>')
def echo(thing):
return "Say hello to my littel friend: %s" % thing
run(host='localhost', port=9999)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment