I could do multiple "elif" lines with a variety of SLEEPDUR values. I could create the files (likely naming them the desired values) and move them in and out of the folder for them to be seen. The only issue I see is that if it is on a 6 hour cycle, then I would have to wait until that cycle is done for it to be changed to a different SLEEPDUR value.Just check if a text file exists at the end of time.sleep().Could I have it import the variable from another script that I could update without interrupting the running code?
If it does set SLEEPDUR = 43200
else set SLEEPDUR = 3600.So to create the file just use touch from the command lineCode:
from pathlib import Pathmy_file = Path("/path/to/file")if my_file.is_file():SLEEPDUR = 43200else:SLEEPDUR = 3600
Then when you are ready just delete it.
Statistics: Posted by duckredbeard — Fri Jan 24, 2025 9:03 pm