本文共 549 字,大约阅读时间需要 1 分钟。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 1. 安装(python2. 7.5 环境) yum - y install epel - release yum - y install python - pip pip install virtualenv mkdir myproject cd myproject / virtualenv venv . venv / bin / activate #激活虚拟环境 pip install Flask 2. 一个简单应用 hello.py #!/usr/bin/python from flask import Flask app = Flask(__name__) @app .route( '/' ) def hello_world(): return 'Hello World' if __name__ = = '__main__' : app.run(host = '192.168.194.130' ) |