I have a list which looks like this:
dates_to_process = ['20201203', '20201201', '20201203']
This list changes every now and then but I try to write those dates into my logfile. I prefer it to be in chronoclical order if thats possible.
This is my code:
with open(log_location, 'a') as output:
if output.tell() == 0:
output.write('Date last Run\n')
output.write(dates_to_process + '\n')
This is my wished outcome if I open the log_file:
Date last Run
20201201
20201202
20201203
This is whay I get now when I run the code:
TypeError: can only concatenate list (not "str") to list