I've been reading up on threading and tried implementing it into my code however I'm not sure if the way I'm doing it, is the best practise.
My code simply imports a self scripted package which pulls weather data and runs the package every 60 seconds thereafter.
I plan on running multiple packages which gather data at once, when I have worked out a good code technique.
from package.weather import weatherapi
import threading
def update():
weatherapi()
threading.Timer(60, update).start()
update()
- Firstly it just seems messy and if I wanted more packages running in a thread, I'd need to create another update function
- Secondly I'm not able to kill my process
If anyone has any suggestions, it would be greatly appreciated.