错误代码门户
PythonPython错误代码

SyntaxError

SyntaxError

代码 SyntaxError · Python 报告的问题。

当解析器遇到语法错误时引发。这可能发生在导入语句中、调用内置函数compile()、exec() 或eval() 中,或者读取初始脚本或标准输入(也可以交互方式)时。 异常实例的 str() 仅返回错误消息。详细信息是一个元组,其成员也可作为单独的属性使用。

Google Translate · 此内容为自动翻译。技术术语及适用条件请以英文原文为准。

Raised when the parser encounters a syntax error. This may occur in an import statement, in a call to the built-in functions compile(), exec(), or eval(), or when reading the initial script or standard input (also interactively). The str() of the exception instance returns only the error message. Details is a tuple whose members are also available as separate attributes.

故障排除与诊断链接

请先确认文档中的产品、版本及发生环境与当前情况一致。