Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -26,8 +26,10 @@ def query2(fetch_url):
|
|
26 |
dictionary=response.json()
|
27 |
#json_object = json.dumps(dictionary, indent=4)
|
28 |
# Writing to sample.json
|
29 |
-
with open("sample.json", "
|
30 |
-
|
|
|
|
|
31 |
return "sample.json"
|
32 |
|
33 |
def find_fn(inp,out_json):
|
@@ -44,7 +46,7 @@ with gr.Blocks() as app:
|
|
44 |
find_btn=gr.Button("Search")
|
45 |
with gr.Row():
|
46 |
out_json = gr.JSON()
|
47 |
-
out_find = gr.
|
48 |
|
49 |
find_btn.click(find_fn,[find_string,out_json],out_find)
|
50 |
fetch_btn.click(query2,data_set_url,out_json)
|
|
|
26 |
dictionary=response.json()
|
27 |
#json_object = json.dumps(dictionary, indent=4)
|
28 |
# Writing to sample.json
|
29 |
+
with open("sample.json", "w") as outfile:
|
30 |
+
json.dump(dictionary, outfile, indent=4)
|
31 |
+
|
32 |
+
#outfile.write(dictionary)
|
33 |
return "sample.json"
|
34 |
|
35 |
def find_fn(inp,out_json):
|
|
|
46 |
find_btn=gr.Button("Search")
|
47 |
with gr.Row():
|
48 |
out_json = gr.JSON()
|
49 |
+
out_find = gr.JSON()
|
50 |
|
51 |
find_btn.click(find_fn,[find_string,out_json],out_find)
|
52 |
fetch_btn.click(query2,data_set_url,out_json)
|