【问题标题】:Visual Studio Code [pylint] E0001:invalid syntax (<string>, line 218)Visual Studio Code [pylint] E0001:无效语法(<string>,第 218 行)
【发布时间】:2018-02-24 23:05:35
【问题描述】:

我正在使用 VS Code 编写 python 脚本,它运行良好,直到我收到与语法无关的错误,现在我无法运行正常运行的脚本。

Here 是带有 VS Code 界面的图像,当我尝试运行脚本时出现错误。

当我将光标悬停在行首的红色取消划线上时,它会显示以下消息:[pylint] E0001:invalid syntax (, line 218)

【问题讨论】:

    标签: visual-studio-code vscode-settings pylint


    【解决方案1】:

    第 213 行有一个未终止的开括号 '('。这些在下面的行中报告为语法错误,因为它们可以在下面的行中终止。括号用于 python 中的行继续。

    包装长行的首选方法是使用 Python 的隐含 圆括号、方括号和大括号内的续行

    https://www.python.org/dev/peps/pep-0008/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-07
      • 2017-09-20
      • 2019-03-31
      • 1970-01-01
      • 2019-07-31
      • 1970-01-01
      • 1970-01-01
      • 2020-08-28
      相关资源
      最近更新 更多