Here is my python script:
from xlrd import open_workbook
from xlrd import xldate_as_tuple
book = open_workbook('C:/Users/.......Constantquotes.xlsx')
sheet0 = book.sheet_by_index(0) #Initializes the first row
print sheet0.row(0) #Prints the first row
date_value = xldate_as_tuple(sheet0.cell(0,1).value,book.datemode)
print date_value #Prints the date cell
# Next step: make the a list for the stock price
# Next step: append the list to a csv
So I am getting the prices into excel, and they update themselves every second. What I would like to do is have the python script read the excel sheet every ten minutes (I will use cronjob to activate the python script) and then append the latest price to a csv file that contains prices for only that stock. The problem is that when I run the python script, it gives me the prices and the date of the last time I SAVED the excel file, and not the CURRENT price. I tried to set options-->save-->save-->save autorecover information--> 1 min, but that didn't help me. So to rephrase the question, how do I make it so that everytime xlrd reads into the .xls file (so that the python script can pull out the current price and date) I get the current price and date, and not the price and date the last time that I saved the .xlxs file?
Ideally I would like to be able to step away from the computer for a few days and come back to a populated .csv
Or perhaps there is a better solution to populate the .csv?