473,395 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1180

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: alejandro david weil | last post by:
Hello! I got the next problem and didn't see any reference to the behaviour that produces it, look: If we have a module like: --- mod.py --------------->8------ testvar2 = 15
0
by: John Roth | last post by:
I've found a case where it seems that Python is importing two copies of a module without any reason or indication. It took me a while to verify that this is what is occuring: I had to write a...
25
by: Xah Lee | last post by:
Python Doc Problem Example: gzip Xah Lee, 20050831 Today i need to use Python to compress/decompress gzip files. Since i've read the official Python tutorial 8 months ago, have spent 30...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
0
by: RayS | last post by:
(Note: there's not a lot of traffic on Win32, so I'm cross-posting here...) To debug pyKeyLogger, I wrote this with pyHook (and compiled with py2exe on Win2K), which prints the ascii codes as...
0
by: learner404 | last post by:
Hello, I have a Windows Pyhon-Tk app which need to capture mouse end keyboard events even when the app is not in focus. On Windows so far I've used the excellent PyHook which does the job...
0
by: =?ISO-8859-15?Q?Jan_B=F6cker?= | last post by:
Hi, i want to write an app which has to log various user activity, such as opening folders and office documents, to help the user keep an overview about what open windows are related to one task...
0
by: randy.tucker7 | last post by:
I use pyhook to monitor user usage of keyboard and mouse. According to pyhook specs, event.time hold the number of seconds since the epoch. However, when I use the example source code I get numbers...
11
by: eBob.com | last post by:
I have this nasty problem with Shared methods and what I think of as "global storage" - i.e. storage declared outside of any subroutines or functions. In the simple example below this "global"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.