[Python] aiuto applicazione con flask

Francesco Pischedda francesco.pischedda a gmail.com
Mar 20 Nov 2018 16:07:17 CET


Il giorno mar 20 nov 2018 alle ore 15:20 Andrea D'alessandro <
andrea.dalessandro a ingv.it> ha scritto:

> Grazie per la risposta ,  anche se quel ciclo while true non mi serve solo
> per sapere se e' in corrente,
> dovrebbe mandare una mail o un messaggio telegram quando la corrente va
> via o ritorna (ovviamente il raspi deve avere la batteria.)
> provero' prima a far girare uno script in background che esegue il ciclo e
> quando si apre la pagina web gli passa la variabile status(in corrente o
> non in corrente)
> anche se il discorso per il mio livello comincia a farsi un po complicato.
>

Per "scomplicarlo" un pochino, invece di passare la variabile alla web app,
potresti mettere questo valore da qualche parte cosí che l'applicazione
flask possa leggerlo;
quindi potresti:
- scrivere lo stato su un file
- scrivere lo stato in un database (anche sqlite3)
- scrivere lo stato in un key value store come redis

-- 
"I really detest the use of the word "training" in relation to professional
activities. Training is what you do to dogs. What you should be doing with
people is educating them, not training them. There is a big, big
difference." - Ron Garret

"Unix IS user friendly. It's just selective about who its friends are"

"Nevertheless I still think it’s a bad idea to make things harder for
ourselves if we can avoid it."

"C is quirky, flawed, and an enormous success."
                                   -- Dennis Ritchie

"Shipping is a feature. A really important feature. Your product must have
it."

"There is no such a thing as a temporary change or workaround: In most
cases, workarounds are tech debt."

"La gatta frettolosa ha fatto i gattini ciechi"
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.python.it/pipermail/python/attachments/20181120/955c1d3a/attachment.html>


Maggiori informazioni sulla lista Python