Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import request as r
|
3 |
+
|
4 |
+
def askPrice():
|
5 |
+
res = r.request('https://orapiweb1.pttor.com/api/oilprice/LatestOilPrice')
|
6 |
+
return res.json()
|
7 |
+
|
8 |
+
#with gr.Blocks() as myApp:
|
9 |
+
# with gr.Row():
|
10 |
+
# with gr.Column(scale=1):
|
11 |
+
# with gr.Column(scale=1):
|
12 |
+
|
13 |
+
app = gr.Interface(fn=askPrice, outputs='json')
|