Spaces:
Sleeping
Sleeping
Commit
·
17ac08e
1
Parent(s):
fd20ce7
Update remainder.py
Browse files- remainder.py +9 -8
remainder.py
CHANGED
@@ -27,15 +27,16 @@ def rem():
|
|
27 |
|
28 |
}
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
|
39 |
|
40 |
st.button("Save",on_click=save_data)
|
|
|
41 |
|
|
|
27 |
|
28 |
}
|
29 |
|
30 |
+
def save_data():
|
31 |
+
with open ("database/data.json")as file:
|
32 |
+
data =json.load(file)
|
33 |
+
allreminder = data["reminders"]
|
34 |
+
allreminder.append(reminder)
|
35 |
+
|
36 |
+
with open("database/data.json","w") as file:
|
37 |
+
json.dump(data,file,indent=4)
|
38 |
|
39 |
|
40 |
st.button("Save",on_click=save_data)
|
41 |
+
save_data()
|
42 |
|