gpt4 book ai didi

python - 使用Python获取语法错误

转载 作者:行者123 更新时间:2023-12-03 08:28:58 25 4
gpt4 key购买 nike

我正在尝试使用Python2.7创建一个简单的键盘记录程序,并为这段代码获取SyntaxError:

def OnKeyboardEvent(event):
logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s'
chr(event.Ascii)
logging.log(10,chr(event.Ascii))
return True

键入此命令后,它将显示无效的语法,并突出显示`(event.Ascii)旁边的 chr

如果您能回答这个问题,谢谢!

(在预览中PS正确地逐行设置了代码)

最佳答案

def OnKeyboardEvent(event):
logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s') # missing )
chr(event.Ascii)

关于python - 使用Python获取语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29463770/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com