Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3847

Python • Re: Best way to run a Python Program

$
0
0
take the temperature reading, turn on or turn off a 5v relay
Just reread this. I also use the try/except to turn off any device I need if it's been set.

Code:

    # Exit Routine - Get here if an error    if 'relay' in locals():        relay.off() # Don't leave lights on        print(log_time("Except/Debug")+"Lights turned off")            return

Statistics: Posted by DS256 — Wed Jul 17, 2024 2:36 pm



Viewing all articles
Browse latest Browse all 3847

Trending Articles