0
Good afternoon! I want to save in a file . xlsx the loop number that my code is running, but the way it is, saves only the last loop.
import time
import pandas as pd
loop = 0
print('Loop')
writer = pd.ExcelWriter('/home/pi/Área de Trabalho/saidaCamera3.xlsx')
while True:
loop = loop + 1
df = pd.DataFrame({'Loop': [loop]})
df.to_excel(writer, 'Camera RGB', index=False)
writer.save()
if loop>=32:
break
writer.save()
It seems a bit silly, but then I’ll join with my sensor reading.