Feb-07-2025, 03:27 PM
so im still building this reminder app. It's got two parts. I need help perfecting it. Basically my app can generate reminders about events/tasks, save them, view them, delete them etc. One of the pieces of information that i store is send status. Because this part of the app will run every time you turn your PC you obviously don't want to send the same reminder twice in a day. Now when it is a single event it is pretty simple, simply change the value of the string in the appropriate cell from No to Yes. the problem is with recurring events. For send dates of recurring events i basically make a list from start date to end date setting the appropriate amount of days between each reminder and then generate the dates that way. Now that means that when a reminder is sent i have to get the index of the date from the send dates list, then use that index to change the send status list element from No to Yes. I tried using replace method didn't work, says index out of range. I tried getting the current date, finding its index in the send date list. Then use that index number to alter the send status list element from "No", to "Yes". Can anyone help please?
EDIT: a part of my code follows:
EDIT: a part of my code follows:
if sent: for ent in data: for date in ent["send date"]: if date==todays_date: ind = ent["send date"].index(todays_date) del ent["send status"][ind] ent["send status"].insert(ind,"Yes") self.save_csv_file(self.CSV_FILE, data)so at the beginning of this function i declare sent as False. i read the csv file into the variable data and check if the day's date exists in the send dates. If so a pop up asks if you want to send the reminder. If the user approves then the reminder is sent and the sent variable is changed to True in order to run the if block i posted above. So then i loop through the send dates as you can see, find the index of the day's date, delete the send status on that index and insert a yes in the same index, finally i call my save function. I tried it, then opened the csv file in excel to see if it worked but the list was still populated only by No.