Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -16,10 +16,9 @@ def add_to_json(goal):
|
|
16 |
data = {"goals": []} # Create the file with an empty 'goals' list if it doesn't exist
|
17 |
|
18 |
new_item = {"Goal": goal}
|
|
|
19 |
|
20 |
-
with open("test.json", "
|
21 |
-
|
22 |
-
data["goals"].append(new_item)
|
23 |
json.dump(data, file, indent=4)
|
24 |
|
25 |
|
|
|
16 |
data = {"goals": []} # Create the file with an empty 'goals' list if it doesn't exist
|
17 |
|
18 |
new_item = {"Goal": goal}
|
19 |
+
data["goals"].append(new_item)
|
20 |
|
21 |
+
with open("test.json", "w") as file:
|
|
|
|
|
22 |
json.dump(data, file, indent=4)
|
23 |
|
24 |
|