python - 通过 Terminus 在 Atom 中运行服务
问题描述
我有一个script.py
脚本,我希望能够从 Atom 的菜单栏运行。我在 Mac 上,所以我决定在 Automator 中创建一个快速服务,在其中运行 AppleScript:
on run {input, parameters}
tell application "Terminal"
do script "python3 /path/to/script.py"
activate
if exists (window 2) then
close window 2
end if
end tell
return input
end run
这很好用:它在菜单中创建一个条目(虽然我希望我可以通过右键单击而不是 Atom > Services > Script 来访问它),然后运行脚本。我在 Atom 中工作,希望脚本使用 Terminus 提示符,而不是打开一个新的终端窗口。我该怎么做呢?
解决方案
推荐阅读
- javascript - jQuery 滚动延迟(滞后)在 chrome 上但在 Firefox 上平滑
- clojurescript - 无法在试剂中添加背景图像
- sql-server - Perl 脚本无法使用 ODBC 连接到 MS SQL:“连接字符串无效”
- model-view-controller - Kendo NumericTextBox 不接受 Unicode 数字(来自其他语言的数字)
- android - 在android studio中为图像添加自定义水印
- git - Azure Devops Server:如何设置构建管道以将 git 源作为任务而不是自动获取
- git - 是否必须将 .gitignore 文件包含到我的 git 存储库中?
- regex - 如何从记事本++中的正则表达式搜索中替换一个字符
- python - 在满足熊猫特定条件的行之间进行简单计算
- css - 如何给我的 SVG 图标冠上金色的线性渐变填充(路径)颜色?