for proc in psutil.process_iter():
if proc.name == "monit":
current_time = time.localtime()
proc_start_time = time.localtime(proc.create_time)
print (current_time - proc_start_time).seconds
我无法找到两个日期时间之间的区别。不能减去它们给出错误 -
TypeError: unsupported operand type(s) for -: 'time.struct_time' and 'time.struct_time'