How to make a script that refreshes / loades every n-second in Python

I used this simple code:

import time
import datetime

intervalInSeconds = 1.0
starttime=time.time()
while True:
  currentTime = datetime.datetime.now()
  print(currentTime)
  time.sleep(intervalInSeconds - ((time.time() - starttime) % intervalInSeconds))

Comments

  1. Wynn Casino and Resort - Mapyro
    Wynn 용인 출장안마 and Encore, Las Vegas. 부산광역 출장안마 3131 S. Las 원주 출장안마 Vegas Blvd. South, 충주 출장마사지 Las Vegas, NV 89109. Directions · (702) 770-7000. Call Now · 하남 출장마사지 More Info. Hours, Accepts Credit Cards,

    ReplyDelete

Post a Comment

Popular posts from this blog

Installing Microsoft ODBC Driver to connect to SQL from Python on Mac OS X

Connection to MSSQL with Pythonan and pyodbc (on Mac OS X)

Installing PyCharm on Mac