Python macros on Mac using Komodo

天大地大妈咪最大 提交于 2019-12-23 17:31:10

问题


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.?

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

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

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


回答1:


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\'}');

and...

// 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\'}');



回答2:


Go to your 'Toolbox', right click the macro you want to save and then click 'Save as'. Copy the saved macros to your Mac. And then click the wrench icon and click 'Import files from file system'

If you have Komodo 7, then you can use the Synchronization feature to sync your macros to multiple computers without much effort.



来源:https://stackoverflow.com/questions/6172314/python-macros-on-mac-using-komodo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!