Hello All,
I'm having some difficulty getting the event IDs to appear normally when I read error
events from
the evnt viewer. The platform is W2KPro, SP1. The code I'm is pasted below for
reference. The
problem is that event IDs recorded in the Event Viewer do not match the event IDs
after I print
them out. It seems to be some "data type" conversion problem. Anyone have any ideas?
Thanks
Mark Albano
===============================================================
import win32evtlog
h=win32evtlog.OpenEventLog( "", "Application")
flags=win32evtlog.EVENTLOG_BACKWARDS_READ|win32evtlog.EVENTLOG_SEQUENTIAL_READ
count=1
while count==1:
records=win32evtlog.ReadEventLog(h, flags, 0)
loop=0
for ev_rec in records:
if records[loop].EventType==1:
print
records[loop].TimeWritten.Format(),records[loop].EventID,records[loop].EventType
loop=loop+1
if prepcount==0:
count=0
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython