-1

I'm trying to make a simple keylogger using Python2.7 and am getting a SyntaxError for this piece of code:

def OnKeyboardEvent(event):
    logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s'
    chr(event.Ascii)
    logging.log(10,chr(event.Ascii))
    return True

Once I type this it says invalid Syntax and highlights the chr next to `(event.Ascii)

If you can answer this THANK YOU!

(PS in the preview the code was set up line by line correctly)

1
  • When I properly formatted your question (use 4 spaces before code when posting on stackoverflow) the reason it gives you a Syntaxerror becomes apparent immediately. Check the end of the previous line for a missing parentheses. I suggest to use an editor with builtin syntax highlighting to see these mistakes easily. Commented Apr 6, 2015 at 0:21

1 Answer 1

1
def OnKeyboardEvent(event):
    logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s') # missing )
    chr(event.Ascii)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.