I want to run a job every day at 9:55 AM to load a data frame into an Excel sheet. I was able to figure out the below code that apparently does that. However, when I run the code, it's sort of perennially stuck in execution mode without any results. I basically do not want to open Pycharm every day to run this code. What do I need to add to run the job every day without me having to do anything at all?
def job():
df=pd.DataFrame(np.random.randn(25).reshape(5, 5), index=[1, 2, 3, 4, 5], columns=['a', 'b', 'c', 'd', 'e'])
writer=pd.ExcelWriter('test.xlsx')
df.to_excel(writer,'Sheet1')
writer.save()
schedule.every().day.at("09:55").do(job)
while True:
schedule.run_pending()
time.sleep(1)