This is the python script that gives the error:
>>> import time
>>> t=[ ]
>>> t.append(time.struct_time(tm_year=2000, tm_mon=11, tm_mday=30, tm_hour=0,tm_min=0,tm_sec=0, tm_wday=3, tm_yday=335, tm_isdst=-1))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: structseq() takes at most 2 arguments (9 given)
This one also gives the same error:
>>> import time
>>> t=time.struct_time(tm_year=2000, tm_mon=11, tm_mday=30, tm_hour=0,tm_min=0,tm_sec=0, tm_wday=3, tm_yday=335, tm_isdst=-1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: structseq() takes at most 2 arguments (9 given)
time.struct_timeexpects its first argument to be a sequence with 9 elements:But note that this overspecifies the datetime.
For instance, you could specify Jan 1, 2000 as having
tm_yday = 100, which is clearly not true:Therefore, it is probably better to use a datetime and call its timetuple() method to obtain a time.struct_time: