def ReportEvent(appName, eventID, eventCategory=0, eventType=win32evtlog.EVENTLOG_ERROR_TYPE, strings=None, data=None, sid=None):
 hAppLog = win32evtlog.RegisterEventSource(None, appName)
 win32evtlog.ReportEvent(hAppLog, eventType, eventCategory, eventID, sid, strings, data)
 win32evtlog.DeregisterEventSource(hAppLog)

def ReportEvent ( appName , eventID , eventCategory = 0 , eventType = win32evtlog . EVENTLOG_ERROR_TYPE , strings = None , data = None , sid = None ) : hAppLog = win32evtlog . RegisterEventSource ( None , appName ) win32evtlog . ReportEvent ( hAppLog , eventType , eventCategory , eventID , sid , strings , data ) win32evtlog . DeregisterEventSource ( hAppLog )
report an event for a previously added event source .