import struct
from collections import namedtuple
StructDeviceInfo = namedtuple('DeviceInfo', ['DeviceID', 'Capturing','Receiving','Socket','DateTime'])
DeviceInfoList = []
def threaded_function():
while True:
if any(x.Capturing == True and x.Datetime in DeviceInfoList different second > 5 for x in DeviceInfoList) : #here,how to do on here?
print('True')
if the DeviceInfoList array inside the Capturing Value is TRUE and at the same time the Datetime are different with datetime.now are more than 5 second. then print true,how to do this?
p/s:the Capturing is TRUE and datetime is more than 5 seconds,must be same array index .
Applied to your example, assuming that
x.Datetimeactually is adatetime.datetimeobject: