- Joined
- Feb 10, 2025
- Messages
- 1
- Reaction score
- 0
i am developing a program for a client. I read from a CSV file. Some of the entries in the csv file (for send dates of the reminder or send status are lists). The specific list i have the problem with is a list of "No" values. I want to be able to change a specific "No" from that list to a "Yes". (NOTES:data is a csv file converted into a list of dictionaries, the variable called sent is only True if there is 0 "No" inside the send status cell) I have tried the following
i tried this first..
here is some of my setup code
first i tried this:
I also tried:
finally i also tried
nothing worked. please help
i tried this first..
here is some of my setup code
Python:
todays_date = datetime.now().strftime(self.DATE_FORMAT)
data = self.read_csv_file(self.CSV_FILE)
Python:
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)
Python:
str(ent["send status"][ind]).replace("No","Yes")
Python:
ent["send status"][ind])="Yes"