Seetha commited on
Commit
32da76d
1 Parent(s): 75feb6e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -508,12 +508,17 @@ def main():
508
  #with open("smalljson.json", "r+") as fi:
509
  #data = fi.read()
510
  #fi.seek(0)
511
- file_jso = open('smalljson.json','r+')
512
- st.write(file_jso.read())
513
- file_jso.truncate(0)
514
- file_jso.write(json_data)
515
- st.write('after',file_jso.read())
516
- file_jso.close()
 
 
 
 
 
517
  # api.upload_file(
518
  # path_or_fileobj=json_data,
519
  # path_in_repo="ch.json",
 
508
  #with open("smalljson.json", "r+") as fi:
509
  #data = fi.read()
510
  #fi.seek(0)
511
+ with open('smalljson.json','r+') as fi:
512
+ data = fi.read()
513
+ st.write(data)
514
+ fi.seek(0)
515
+ fi.write(json_data)
516
+ st.write('after',fi.read())
517
+ fi.truncate()
518
+ # file_jso.truncate(0)
519
+ # file_jso.write(json_data)
520
+ # st.write('after',file_jso.read())
521
+ # file_jso.close()
522
  # api.upload_file(
523
  # path_or_fileobj=json_data,
524
  # path_in_repo="ch.json",