import pandas as pd
if __name__=='__main__':
while True:
try:
date = dt.datetime.now()
frame = pd.DataFrame([
[date, b, c, d]
],
columns=['date', 'b', 'c', 'd'] ####
)
frame.to_csv('1.csv')
except:
print('ERROR:', sys.exc_info())
frame.to_csv('1.csv', mode='a', header=False)