開発環境
- OS X Yosemite - Apple (OS)
- Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
- Python 3.4 (プログラミング言語)
Introducing Python: Modern Computing in Simple Packages(Bill Lubanovic (著)、 O'Reilly Media)のChapter 8(The Web, Untangled)、Things to Do 9.3.を解いてみる。
Things to Do 9.3.
コード(Eacs, BBEdit)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import flask
app = flask.Flask(__name__)
@app.route('/')
def home():
return "It's alive!."
app.run(port=5000, debug=True)
入出力結果(Terminal, IPython)
$ ./sample3.py * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) * Restarting with stat 127.0.0.1 - - [13/Mar/2015 11:55:59] "GET / HTTP/1.1" 200 - C-c C-c$
0 コメント:
コメントを投稿