Difference between revisions of "Bottle"

From emboxit
Jump to: navigation, search
 
m (1 revision)
 
(No difference)

Latest revision as of 16:51, 11 September 2015


  • Hello scripts that worked
  • nx.py

<python> from bottle import route, run

@route('/hello') def hello():

   return "Hello World!"

run(host='localhost', port=8080, debug=True) </python>


  • nx2.py

<python> from bottle import Bottle, run, template

app = Bottle()

@app.route('/hello') def hello():

   return "Hello World!........"

run(app, host='localhost', port=8080) </python>


  • As python was not in the windows7 path, I run as below from command-prompt:
c:\python26\python nx.py
from a folder that contains only nx.py and bottle.py