I'm hoping you can help (as always). I'm making a photobooth and in short have a Python script to control the light (switches on for 30 seconds) and another to take 4 photos for the photobooth. I need to run the light script followed by the camera script 5 seconds later. I'm sure this is easy, but can't work it out. Here's what I've tried:
I'm not even sure if this is correct for the Raspberry Pi, but this is what I've tried inc. variations:
import threading
import time
def light():
while time.time() <= start_time:
pass
threading.Thread(target="sudo python /home/pi/python/light30.py").start()
def camera():
while time.time() <= start_time:
pass
threading.Thread(target="sudo python /home/pi/python/camtest.py").start()
start_time=time.time()+5
threading.Thread(target=light).start()
threading.Thread(target=camera).start()
Any help you can provide would be great, as I'm sure im being an idiot.
Threadtarget argument should be callable object, not string.