Upload testFlask.py
Browse files- testFlask.py +26 -0
testFlask.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python
|
2 |
+
# coding: utf-8
|
3 |
+
|
4 |
+
# In[1]:
|
5 |
+
|
6 |
+
|
7 |
+
get_ipython().system('pip install flask')
|
8 |
+
from flask import Flask, request
|
9 |
+
|
10 |
+
app = Flask(__name__)
|
11 |
+
|
12 |
+
@app.route('/add', methods=['GET'])
|
13 |
+
def add():
|
14 |
+
a = request.args.get('a', type=int)
|
15 |
+
b = request.args.get('b', type=int)
|
16 |
+
return str(a + b)
|
17 |
+
|
18 |
+
if __name__ == '__main__':
|
19 |
+
app.run(debug=True)
|
20 |
+
|
21 |
+
|
22 |
+
# In[ ]:
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
|