From 5ba1d71cb3b23e1c3b0459e7ae40247f93dfdd74 Mon Sep 17 00:00:00 2001 From: scossa Date: Mon, 3 Oct 2022 10:02:00 +0200 Subject: [PATCH] Update 'ScrapeJE.py' --- ScrapeJE.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ScrapeJE.py b/ScrapeJE.py index de22ed7..e935e5e 100644 --- a/ScrapeJE.py +++ b/ScrapeJE.py @@ -88,6 +88,7 @@ print("lista prezzi:",len(prezzo)) #sono stringhe ovvero ci sono anche prezzi co #Crea file json formattato per jawanndenn con la lista dei nomi dei prodotti +#scrive le prime righe del json (uguali ogni volta) with open('jwndn.json', 'w') as jw: jw.write("{\n") jw.write(' "lifetime": "month",\n') @@ -99,13 +100,14 @@ with open('jwndn.json', 'w') as jw: jw.write("\n") jw.write(' "options": \n') - +#inserisce i nomi dei prodotti dalla lista def writeListJSONFile(filepathname, lista): with open('./jwndn.json', 'a+') as f: json.dump(nome, f) writeListJSONFile('./jwndn.json', nome) +#conclude il json con l ultima parentesi graffa with open('jwndn.json', 'a+') as jw: jw.write("\n}\n") @@ -116,7 +118,7 @@ with open('jwndn.json', 'a+') as jw: #automatizzare l inserimento in jawandenn #PS jawanndenn include la funzione per argomento -#"jawanndenn --loaddata FILE.json" --> Load a JSON export of the database from FILE.json, then quit. #MA NON MI FUNZIONA! +#"jawanndenn --loaddata FILE.json" --> Load a JSON export of the database from FILE.json, then quit. #aggiungere la possibilità di mettere piu di un voto al doodle (ovvero prendere piu prodotti come es: 2 fatayer al formaggio)