gpt4 book ai didi

python - 如何从 Sublime Text 2 在 OSX 终端中显示构建结果

转载 作者:行者123 更新时间:2023-11-28 17:47:53 25 4
gpt4 key购买 nike

我刚从 TextMate 切换到 Sublime Text 2,我非常喜欢它。困扰我的一件事是默认的构建结果显示在 ST2 的底部。我的程序产生了一些非常长的结果,显示它的理想方式(如在 TM2 中)是并排查看它们。

如何在 Mac OS 中使用 ST2 做同样的事情?我找到了 this article其中讨论了如何在 Linux 中完成此操作。但仍然没有弄清楚如何将其适配到 Mac OS。

非常感谢!

最佳答案

您可以创建一个 shell 脚本,通过 osascriptTerminal.app 中将传递的输入作为 Python 脚本执行,像这样:

#!/bin/sh
osascript -e '
on run parameters
tell application "Terminal"
activate
do script with command "python " & parameters
end tell
end run
' $@

然后您可以创建构建系统:

{
"cmd": ["sh PATH_TO_SHELL_SCRIPT \"$file\""],
"shell": true
}

关于python - 如何从 Sublime Text 2 在 OSX 终端中显示构建结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15462566/

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