it is necessary for the program to stop the while loop at exactly the appointed time, now I do this:
import datetime import time import requests while datetime.datetime.now().strftime('%H%M%S') != '143400': requests.get('url') time.sleep(10) #Выполнение операции print в 14:34:00 print('End') But the problem is that if time.sleep (10) is called, for example, at 14:33:59 (later than 10 seconds before the end) or the request does not have time, the cycle will become infinite. Tell me, please, how to make sure that any operation stops at the appointed time. The site to which requests are submitted is not rarely overloaded, and because of this, it takes requests for a long time.