【问题标题】:Sublime Text 3 - Stop printing shell cmd, dir and path when error is raisedSublime Text 3 - 出现错误时停止打印 shell cmd、dir 和路径
【发布时间】:2016-08-10 09:37:23
【问题描述】:

我希望我的 Sublime Text 不会在每次我的代码抛出错误时打印出以下额外信息。

请看下面的例子 - 我不需要看到我的 shell_cmd、dir 或要打印的路径,只是为了清楚起见!

我一直在寻找解决方案,但似乎找不到可行的解决方案。

非常感谢您的任何反馈!

【问题讨论】:

  • 您可以编辑构建系统并添加"quiet": true,。然后它不会显示命令和PATH。但是,它也会禁用其他信息,例如持续时间。
  • 嗨@r-stein,感谢您的快速回复。您能否详细说明我在哪里包含上述命令?

标签: python-2.7 debugging sublimetext2 sublimetext3 sublimetext


【解决方案1】:

您可以使用PackageResourceViewer 编辑python 构建系统。只需在Python/Python.sublime-build 中打开构建系统并添加属性"quiet": true,

生成的构建系统应如下所示:

{
    "shell_cmd": "python -u \"$file\"",
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python",
    "quiet": true,

    "variants":
    [
        {
            "name": "Syntax Check",
            "shell_cmd": "python -m py_compile \"${file}\"",
        }
    ]
}

不过,这也会抑制其他输出,例如持续时间。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-25
    • 2016-10-02
    • 2018-01-02
    • 1970-01-01
    • 1970-01-01
    • 2014-09-18
    相关资源
    最近更新 更多