在Mac上使用Komodo的Python宏 [英] Python macros on Mac using Komodo

查看:75
本文介绍了在Mac上使用Komodo的Python宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Komodo IDE,版本6.1.1,内部版本61234,平台macosx-x86.我也在使用Python 3.2和Python 2.7.我只是开始使用(我的第一个)Mac.操作系统版本10.6.?

I'm using Komodo IDE, version 6.1.1, build 61234, platform macosx-x86. I'm also using Python 3.2 and Python 2.7. I've just moved to using (my first) Mac. OS version 10.6.?

在Windows计算机上,我设置了一些我想继续使用的宏:

On my Windows machines I had a couple of macros set up that I would like to continue to use:

F2:保存文件,然后使用Python 2.x运行,结果显示在选项卡中,从当前目录开始
F3:保存文件,然后使用Python 3.x运行,结果显示在选项卡中,从当前目录开始

F2: save file and then run using Python 2.x, results in tab, start in current directory
F3: save file and then run using Python 3.x, results in tab, start in current directory

任何想法如何做到这一点?我对使用Mac非常陌生,所以我不知道从哪里开始.

Any idea how to do this? I'm very new to using a Mac so I don't know where to start.

推荐答案

我最终编写了自己的宏-见下文...

I ended up writing my own macros - see below...

// Macro recorded on: Thu Jun 10 2010 08:50:50 GMT+1000 (AUS Eastern Standard Time)
komodo.assertMacroVersion(3);
if (komodo.view && komodo.view.scintilla) { komodo.view.scintilla.focus(); }
komodo.doCommand('cmd_save')
ko.run.runEncodedCommand(window, '/usr/local/bin/pythonw \"%F\" {\'cwd\': u\'%D\'}');

和...

// Macro recorded on: Thu Jun 10 2010 08:50:50 GMT+1000 (AUS Eastern Standard Time)
komodo.assertMacroVersion(3);
if (komodo.view && komodo.view.scintilla) { komodo.view.scintilla.focus(); }
komodo.doCommand('cmd_save')
ko.run.runEncodedCommand(window, '/usr/local/bin/pythonw3 \"%F\" {\'cwd\': u\'%D\'}');

这篇关于在Mac上使用Komodo的Python宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆