-
Navigate on your web browser to https://www.python.org/downloads
-
Click on Download Python 2.7.11
-
Install the downloaded package using the default settings
-
Open a terminal prompt: WindowsKey + R -> cmd.exe -> Enter
-
Type: c:\python27\scripts\pip.exe install bottle
-
Open windows explorer, navigate to your Documents folder, create a new folder called webdev1 and navigate to it
-
Press Alt key on keyboard, click on File -> New -> Text Document
-
Name your new file test1.py and open it with a text editor, standard notepad will do, but you will not be able to edit it by double-clicking on the file
-
Insert the following code in the file:
from bottle import route, run, template @route('/hello/<name>') def index(name): return template('<b>Hello {{name}}</b>!', name=name) run(host='localhost', port=9090)
-
Double-click on the test1.py file to run it, a prompt window should appear with a text like Bottle v0.12.9 server starting up... etc
-
Navigate on your web browser to http://localhost:9090/hello/world
-
Enjoy your first Python web application!
Last active
February 11, 2016 11:26
-
-
Save davidrios/96ad6441fd185c98e33f to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment