Andrew 76868
Andrew 76868

Reputation: 414

Make Jupyter Notebook script work 1 time per hour

I have a Jupyter Notebook. Here is just a simplified example.

#Parsing the website
def parse_website_function(url):
  return(value,value2)

#Making some calculations(hypothesis)
def linear_model(value, value2):
  return(calculations)

#Jot down calculations to csv file     
pd.to_csv(calculations)

I would like to know how to make it work every hour and enable to rewrite(add new rows) to csv time series data in the same output file. Thanks!

Upvotes: 0

Views: 328

Answers (1)

Christian Gabor
Christian Gabor

Reputation: 161

A really basic way to do this would be to just make the program sleep for 3600 seconds.

For example this would make your program pause for 1 hour:

import time
time.sleep(3600)

Upvotes: 1

Related Questions