Flask mqtt esp32 for dummies

heh. Believe it or not… I have email alerts turned on. The email shows everything in plain text.

so

[scode lang=“python”]
with open(file) as file:
do_something
[/scode]

if you open a file using the ‘with’ function, then it automagically closes it after it’s through with ‘do_something’.

This does mean that with the way I wrote my edit function, if values are being changed I’m opening/closing the file twice.

BTW… are you running your code under gunicorn or something? Right now I’m just running the straight python file, but I’m not so sure that’s very smart.