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')
如果 Capturing Value 中的 DeviceInfoList 数组为 TRUE,同时 Datetime 与 datetime.now 不同,则超过 5 秒。然后打印真实,如何做到这一点?
p/s:Capturing 为 TRUE 且 datetime 大于 5 秒,必须是相同的数组索引。