Trying to create a zip file with yesterdays date. I think I got everything, but I am getting module has no object attrib error. Any ideas?
import os
import zipfile
import datetime
today = datetime.date.today()
yesterday = (today + datetime.timedelta(days=-1))
file = zipfile.Zipfile("CT" + yesterday.strftime('%m%d%y') +".zip", "w")
files = os.listdir("c:\\crunchtime")
for f in files:
file.write(f)