Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16743

How to create seperate time.sleeps in python?

$
0
0

I'm new to python

import timeimport randomdaily = ("/daily")ten = ("/ten")hourly = ("/hourly")while hourly == "/hourly":     print("TYPE_HOURLY")    time.sleep(3605)while ten == "/ten":    print("TYPE_TEN")    time.sleep(605)while daily == "/daily":    print("TYPE_DAILY")    time.sleep(86500)

Forgive my code, this is my first time ever coding, what I'm trying to accomplish is having separate timers go off for daily, ten, and hourly. currently it is running only hourly and then "sleeping" how would I fix this?

I expect it to run all 3 of them at once and then sleeping for 3605 seconds, 605 seconds and 86500 seconds depending on what amount of time I specified


Viewing all articles
Browse latest Browse all 16743

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>