Nechba commited on
Commit
69dbd6d
·
verified ·
1 Parent(s): b66d262

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -252,9 +252,9 @@ with st.container():
252
  response_data = json.loads(response.text)
253
  if response_data.get('status')=='success':
254
  json_str =response_data.get("json")
255
-
256
  # Encode this JSON string to bytes, which is required for the download
257
- json_bytes = json_str.encode('utf-8')
258
  st.download_button(
259
  label="Download JSON",
260
  data=json_bytes,
 
252
  response_data = json.loads(response.text)
253
  if response_data.get('status')=='success':
254
  json_str =response_data.get("json")
255
+ json_formatted_str = json.dumps(json_str) # Convert list to JSON formatted string
256
  # Encode this JSON string to bytes, which is required for the download
257
+ json_bytes = json_formatted_str.encode('utf-8')
258
  st.download_button(
259
  label="Download JSON",
260
  data=json_bytes,