H
H
hardwellZero2015-02-05 02:22:36
Python
hardwellZero, 2015-02-05 02:22:36

What is the correct way to loop over time?

There is an infinite while loop.
You need to run it after n-th time.
time.sleep() - Sleeps a process.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dmitry, 2015-02-05
@dmitryprogrammer

what language is this? js, php, what?

I
Ilya, 2015-02-05
@FireGM

You have some kind of problem in your code. time.sleep should not lay. If you do not want to refactor, then it is better to remove the loop altogether and use cron, for example.

A
Alexey, 2015-02-05
@ZeLib0ba

What are the arguments for time.sleep? It has the syntax
time.sleep(t) where t is the number of seconds

A
Alexey Cheremisin, 2015-02-05
@leahch

Take twisted and do it:
www.saltycrane.com/blog/2008/10/running-functions-...
Well, by the way, I recommend this framework, I work on it myself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question