Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -505,11 +505,11 @@ def main():
|
|
505 |
json_data = json.dumps(data_list)
|
506 |
|
507 |
# Write the JSON data to a file
|
508 |
-
with open("smalljson.json", "
|
509 |
-
|
510 |
-
|
511 |
fi.write(json_data)
|
512 |
-
|
513 |
# api.upload_file(
|
514 |
# path_or_fileobj=json_data,
|
515 |
# path_in_repo="ch.json",
|
|
|
505 |
json_data = json.dumps(data_list)
|
506 |
|
507 |
# Write the JSON data to a file
|
508 |
+
with open("smalljson.json", "r+") as fi:
|
509 |
+
data = fi.read()
|
510 |
+
fi.seek(0)
|
511 |
fi.write(json_data)
|
512 |
+
fi.truncate()
|
513 |
# api.upload_file(
|
514 |
# path_or_fileobj=json_data,
|
515 |
# path_in_repo="ch.json",
|