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

Python • Scheduled task doesnt run

$
0
0
Hello, I am relatively new to python. I am using systemd to run a python script i have called scheduler.py. If a switch status is set to 1 then a second script relay_test6.py should run using exec(open....read). I have checked the status of the scheduler which shows that it is running and that the task in hand is to run scheduler.py Please see screenshot. However, the second script, relay_test6.py is not initiated.

Code:

    if status == '1':            print("Job Executing level 1!")                exec(open("/var/www/html/relay_test6.py").read())
If I open Thonny and run scheduler.py then relay_test6.py is initiated and runs successfully. What am i doing wrong?
scheduler_screenshot.png

Statistics: Posted by Julian62 — Fri Jul 25, 2025 9:13 pm



Viewing all articles
Browse latest Browse all 1526

Latest Images

Trending Articles



Latest Images