Komodo Edit save and run python macro

Monday, July 14th, 2008
Advertisement

Subscribe.
Enter your email:

Komodo Edit is a good editor for many programming language. However, since it is free as compared to its brother Komodo IDE, there is lack of debugging function. But, Macro and run command do exist though. You can make use of those feature to save and debug your script with a click of a shortcut key.

Step 1: Create a new macro.

Add New Macro

Step 2: Enter the macro script below.

if (komodo.view) { komodo.view.setFocus() };
komodo.doCommand('cmd_save')
ko.run.runEncodedCommand(window, '%(python) \"%F\" {\'cwd\': u\'%D\'}');

You are free to change %(python) to %(perl), provided that perl is installed, and the environment path is set.

Enter the macro script

Step 5: Set a key binding to the new created macro.

Set a shortcut key

Now you just need to press the ‘F5′ key inorder to save and run a python script.

If you are new here, you might want to subscribe to the RSS feed or newsletter.

Enter your email address:

Creates the exact copy of your hard disk and allows you to instantly restore the entire machine.
New Acronis True Image Home 2010 is the most reliable and easy in use backup solution. Now with online backup option!
15% Discount Code: FMAATIH2010

What else?

Like this article? Share it

 Digg  del.icio.us  TwitThis  Facebook  Reddit  StumbleUpon

One Response to “Komodo Edit save and run python macro”

  1. Martin says:

    Slightly improved:

    if (komodo.view) { komodo.view.setFocus() };
    komodo.doCommand(‘cmd_save’)
    ko.run.runEncodedCommand(window, ‘”%(python)” \”%F\” {\’cwd\’: u\’%D\’}');

    Needed for people like me whose Python installation has a space in its path.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>