Answer the question
In order to leave comments, you need to log in
How can you do a time check in Python?
How can you implement time checking in Python?
I have js script:
function lg() {
document.querySelector("#checkout > div.buttonContainer > button").click();
}
function doCheck() {
const now = new Date();
if (now.getHours() !== 13) { // часы
timeout(5);
}
else {
if (now.getMinutes() !== 00) { // минуты
timeout(5);
}
else {
if (now.getSeconds() !== 00) { // секунды
timeout(5);
}
else {
setTimeout(lg, 1); // Задержка на выполнение скрипта в мс
}
}
}
}
function timeout(ms = 1) {
setTimeout(() => {
doCheck();
}, ms);
}
doCheck();
Answer the question
In order to leave comments, you need to log in
To do this, you can use task schedulers, in Linux it is cron, in windows it also seems to have its own task scheduler, and directly under Python there is something like Celery
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question