I want to request some data from a python module tushare. By using this code, I can each time get a line of data. However I want to send the server a request for like every 5 seconds and put all the data within 4 hrs into one excel file. I notice that pandas is already built in tushare. How to put the data together and generate only one excel file?
import tushare as ts
df=ts.get_realtime_quotes('000875')
df.to_excel(r'C:\Users\stockfile\000875.xlsx')