Commit e118dcfa authored by Rousseau Vincent's avatar Rousseau Vincent
Browse files

New file every month

parent 72bd6771
......@@ -25,7 +25,7 @@ data_folder = Path('./data')
data_folder.mkdir(parents=True, exist_ok=True)
try:
while(True):
current_minute = datetime.now().minute
current_month = datetime.now().month
file_date = datetime.now().strftime('%Y_%m_%d_%H_%M')
file_name = data_folder/str('sense_hat_data_' + file_date + '.csv')
with file_name.open('w') as csvfile:
......@@ -35,7 +35,7 @@ try:
while(True):
writer.writerow(get_data())
time.sleep(1)
if(current_minute != datetime.now().minute):
if(current_month != datetime.now().month):
break
except KeyboardInterrupt:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment