1
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

2 つの日時の違いを見つけることができません。それらを差し引くことはできませんエラー -
TypeError: unsupported operand type(s) for -: 'time.struct_time' and 'time.struct_time'

4

1 に答える 1