for ループでタプルを設定しようとすると、ここに何かが欠けているに違いありません。
...more code above...
colItems = objSWbemServices.ExecQuery(queryString)
#print type(colItems)
上記の行は必要ですか?
# print the results
for item in colItems:
logTuple = (item.SourceName, item.Type, item.TimeGenerated, item.Message)
logTuple.sort(sortByTime)
return logTuple
上記のコードは、これらのフィールドをタプルに入力しますか?
以下はソートするコードですが、まだテストできていません。
def sortByTime(t1, t2):
if t1[2] < t2[2]:
return -1
elif t1[2] > t2[2]:
return 1
else:
return 0
助けてくれてありがとう。