1 安装python2.7.13
安装文件为:python-2.7.13.amd64.msi,因为python2.7.13中已经包含了pip.
在安装过程中选中【Add python.exe to Path】,如下图:

或安装完成后手工将【C: oolsPython27;C: oolsPython27Scripts;】添加到【path】环境变量中去。
2 安装flask
执行:
pip install flask
3 验证
生成hello.py文件,文内容如下:
# coding=UTF-8
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run()
执行
python hello.py
执行结果:
C: est>python hello.py * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
在浏览器中访问:
