Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -3,14 +3,14 @@ import json
|
|
3 |
import google.generativeai as genai
|
4 |
|
5 |
|
6 |
-
def add_to_json(
|
7 |
try:
|
8 |
with open("test.json", "r") as file:
|
9 |
data = json.load(file)
|
10 |
except FileNotFoundError:
|
11 |
data = {"goals": []} # Create an empty "goals" list if the file doesn't exist
|
12 |
|
13 |
-
new_item = {"Goal":
|
14 |
data["goals"].append(new_item)
|
15 |
|
16 |
with open("test.json", "w") as file:
|
|
|
3 |
import google.generativeai as genai
|
4 |
|
5 |
|
6 |
+
def add_to_json(hole):
|
7 |
try:
|
8 |
with open("test.json", "r") as file:
|
9 |
data = json.load(file)
|
10 |
except FileNotFoundError:
|
11 |
data = {"goals": []} # Create an empty "goals" list if the file doesn't exist
|
12 |
|
13 |
+
new_item = {"Goal": hole}
|
14 |
data["goals"].append(new_item)
|
15 |
|
16 |
with open("test.json", "w") as file:
|