Question:
Hi,
I have some python code that I want to invoke a call (or an API endpoint in my code) or just call a python script every T time?
Replit Profile: https://replit.com/@
Question:
Hi,
I have some python code that I want to invoke a call (or an API endpoint in my code) or just call a python script every T time?
Replit Profile: https://replit.com/@
You can run some code on some interval using threads (python - Run certain code every n seconds - Stack Overflow)
import threading
def printit():
threading.Timer(5.0, printit).start()
print "Hello, World!"
printit()
Or if you want to run an entire script every t seconds you type this in the shell:
while sleep <t seconds here>; do python <path to script here>; done
Is that what you were looking for?
I guess that can work.
I need it to run every Friday, and I figured cron would be the easiest way to do it
Maybe make the repl only start on fridays and run its thing once each friday, then set up lots of cron jobs to send a request to it each Friday