Implementazione salvataggio su file #1

Merged
AndreStork merged 5 commits from filedump into main 2026-03-03 10:25:36 +00:00
Showing only changes of commit 8c870484ac - Show all commits

2
app.py
View File

@@ -12,7 +12,7 @@ def update_file():
if os.path.isfile('compiti.json'): if os.path.isfile('compiti.json'):
with open('compiti.json', 'r') as f: with open('compiti.json', 'r') as f:
compiti = json.load(f) compiti = json.load(f)
id_counter = 104 id_counter = compiti[-1]["id"] + 1
else: else:
compiti = [ compiti = [
{"id": 1, "descrizione": "Compito matematica"}, {"id": 1, "descrizione": "Compito matematica"},