V
V
Vadim kyklaed2017-03-06 22:11:28
Python
Vadim kyklaed, 2017-03-06 22:11:28

Sending messages at a specific time, how to do it?

Good evening!
Please tell me how to make the script run at the right time, I have a database in it, there is a field with dates in Unix format, I need to send messages at the right time, which corresponds to the time from the database. how to do it right?
Here is an example of
Time Stamp:
1488827040
I need to send a message
vkapi.messages.send(domain='adm', message="q")
and this should be done about every hour, the problem is that if you set the script to a certain launch interval, then you can not hit at the right time which results in not sending the message.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilyas, 2017-03-06
@id2669099

cron?

D
Dimonchik, 2017-03-06
@dimonchik2013

1) send by if delta > N
2) time.sleep() to adjust so that N is smaller
second per second may not work, and it is not necessary

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question