I am currently building a program and want to sort data (called component in the code) by week number.
wList = []
thing = []
Wstart = 0
for component in list:
curDate = component[0]
year, month, day = (int(x) for x in curDate.split('-'))
currentWeek = int(datetime.date(year, month, day).strftime("%V"))
if Wstart == currentWeek or Wstart == 0:
wList.append([component, component, component, component])
Wstart == currentWeek
else:
thing.append(Wlist)
wList = []
wList.append([component, component, component, component])
Wstart == currentWeek
Basically I want to reset the Wlist when a new week is available, and store the Wlist in a list called thing, but when I run print(thing) I got "[]".
I appreciate all the help I can get!