Question

I am currently starting to work on a web server running web.py . If I understand it correctly, the whole thing is implemented as some kind of a loop that listens to the requests at the specified port and reacts accordingly.

I would like the server to perform a certain action at a certain time without a request that triggers it. What is the best way to achieve this? Thank you.

Was it helpful?

Solution

If you want to run it within python you can look at using the threading class.

More information on how to do it here: Executing periodic actions in Python

OTHER TIPS

I think the best way is to set up a cron job in the system, which will execute your script (which can be written in Python or other language).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top