I have a python program that will print out the csv columns “expiration date” and “account name”. How would I write the code to only print out the account columns if the date in “expiration date” is only 3 days away from the time the code is executed?
Example of csv
expiration date account name 1/2/2017 mary 4433 12/25/2018 bob 1244 1/31/2017 david 1234
code so far
import csv
with open('ResellerAccounts-1.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
accounts = []
expiries = []
for row in readCSV:
account = row[0]
expire = row[7]
expiries.append(expire)
accounts.append(account)
print(accounts)
print(expiries)
thanks!