当我在Sublime Text 2上按一个键时,我想运行一个外部python脚本(或外部命令/程序)。
我该怎么做?
答案 0 :(得分:14)
这是solution:
偏好设置 - >密钥绑定 - 用户并将其放入文件中(覆盖[
,]
内部):
[
{ "keys": ["<your shortucut>"], "command": "exec", "args": { "cmd": ["<path to your script>"]} }
]
名称所示的<your shortcut>
是快捷方式(例如: F1 , ctrl + shift + F1 等)和<path to your command>
是您的命令的位置(示例:echo
,/home/user/scripts/my_script.py
,{ {1}}等。)