title: python listen the windows log event
body: <p>I readed example ,about use pywin32 to read windows event log :</p>
  
  <p><a href="http://docs.activestate.com/activepython/2.4/pywin32/Windows_NT_Eventlog.html" rel="nofollow">Python's win32 access for the Eventlog</a></p>
  
  <p>now i wonder if i could take the next step :<br>
  Fire a python function (my code) ,once a windows event log has arrived(may be the log was set by  other application ), so i can monitor the event in real time .</p>
  
  <p>i goole it the whole day, and can't find a good resolve.
  that's my test code :</p>
  
  <pre><code>import win32evtlog
  import win32event
  
  def function_wait():
      #i check the new windows log is set , but this function wasn't fired
      print 'a new event log.' 
  
  file_open_hand = win32evtlog.OpenEventLog('my-pc','Application')
  # i thought it's definitly wrong below, but i have no idear about the 4th parameter!
  hEvent = win32event.CreateEvent (None, 1, 0, 'function_wait') 
  
  win32evtlog.NotifyChangeEventLog(file_open_hand,hEvent)
  
  inputx = raw_input("wait for event log fire...")
  </code></pre>