469,303 Members | 2,066 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,303 developers. It's quick & easy.

problem with pyHook module

I want to use the pyHook module to capture all keyboard input and write it
to a file. I have a script that works fine with the command prompt, but I
have a few issues I need help with. First, I want to be able to set up an
html page that has a link to this script and have it start running and
collecting output, and then use some keystroke like alt+f4 to terminate the
application. It seems when I run this script from internet explorer after
placing it in cgi-bin, the log file gets created but nothing is written to
it. i'm running xampp with python 24 and all the necessary stuff.
Eventually I'd like to try to get the shift key with a letter to indicate an
upper cased letter, but first I at least want to get all the keys written to
a file. Can anyone help? The sscript I'm starting with is below.
#!c:\Python24\python.exe
print "Content-type:text/html\n\n";
import pyHook
f = open('file.log','w')
def onKeyboardEvent(event):

f.write(event.Key)

return True
hm = pyHook.HookManager()
hm.KeyDown = onKeyboardEvent
hm.HookKeyboard()
if __name__ == '__main__':
import pythoncom
pythoncom.PumpMessages()

Dec 28 '05 #1
0 1095

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by alejandro david weil | last post: by
reply views Thread by John Roth | last post: by
6 posts views Thread by TPJ | last post: by
reply views Thread by RayS | last post: by
reply views Thread by =?ISO-8859-15?Q?Jan_B=F6cker?= | last post: by
reply views Thread by randy.tucker7 | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.