I have to add a subject line to a list of other subject lines. This is normally an easy task, except this time, the email subject line always includes the date it was sent. How would I include this into my code?
Basically, I have the subject line "YYYY-MM-DD_Rest_of_Non-changing_Subject_Line" and I want to add anything that matches the first date part+the rest of the string to a list.
changning_date_subject = str(datetime.strptime('', '%Y-%m-%d')) + '_Rest_of_Non-changing_Subject_Line'
accepted_subjects = [changing_date_subject, 'Other Static Subject1', 'Other Static Subject2', 'Other Static Subject3']
I get ValueError: time data '' does not match format '%Y-%m-%d'", and while I understand why it would say that an empty string doesn't match, I can't really add a hard-coded string because it will change each time. Ideas? Thanks in advance!