2018年5月23日水曜日

開発環境

入門 Python 3 (Bill Lubanovic (著)、斎藤 康毅 (監修)、長尾 高弘 (翻訳)、オライリージャパン)の9章(ウェブを解きほぐす)、9.4(復習問題)1、2、3.を取り組んでみる。

コード(Emacs)

Python 3

#!/usr/bin/env python3

print('9-1')

from flask import Flask

app = Flask(__name__)


@app.route('/')
def home():
    return "It's alive."


app.run(port=5000, debug=True)

入出力結果(Terminal, Jupyter(IPython))

$ ./sample1.py
9-1
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
9-1
 * Debugger is active!
 * Debugger PIN: 873-014-066
127.0.0.1 - - [23/May/2018 18:14:54] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [23/May/2018 18:14:57] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [23/May/2018 18:14:59] "GET /index.html HTTP/1.1" 404 -
^C$

0 コメント:

コメントを投稿