<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Il giorno mar 20 nov 2018 alle ore 15:20 Andrea D'alessandro <<a href="mailto:andrea.dalessandro@ingv.it">andrea.dalessandro@ingv.it</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Grazie per la risposta ,  anche se quel ciclo while true non mi serve solo per sapere se e' in corrente,<div>dovrebbe mandare una mail o un messaggio telegram quando la corrente va via o ritorna (ovviamente il raspi deve avere la batteria.) </div><div>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)</div><div>anche se il discorso per il mio livello comincia a farsi un po complicato.</div></div></blockquote><div> </div><div>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;</div><div>quindi potresti:</div><div>- scrivere lo stato su un file</div><div>- scrivere lo stato in un database (anche sqlite3)</div><div>- scrivere lo stato in un key value store come redis</div><div><br></div><div>-- <br></div></div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">"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." - <span style="letter-spacing:0.2px">Ron Garret</span></div><div dir="ltr"><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium;letter-spacing:normal"><br></span></div><div dir="ltr">"Unix IS user friendly. It's just selective about who its friends are"<br><br>"Nevertheless I still think it’s a bad idea to make things harder for ourselves
if we can avoid it."<br><span><br>"C is quirky, flawed, and an enormous success."<br>                                   -- Dennis Ritchie<br></span><br><span>"Shipping is a feature. A really important feature. Your product must have it."<br><br>"</span><span>There is no such a thing as a temporary change or workaround: In most cases, workarounds are tech debt."<br><br></span></div><div>"La gatta frettolosa ha fatto i gattini ciechi"<br><br></div></div></div></div></div></div></div></div></div></div>