一个简单的Flask例子
1、安装Flask
pip install Flask
from flask import Flask
app = Flask(__name__)
@app.route("/index1")
def hello():
return "hello world!"
@app.route("/python")
def python():
return "hello python!"
if __name__ == "__main__":
app.run()
2、request 调用
x=requests.get('http://127.0.0.1:5000/index1')
print(x.text)