1

Possible Duplicate:
Komodo - watch variables and execute code while on pause in the program

I am using Komodo IDE with Debug in separate console window option in order to debug curses based program. So the output goes to console window. However, I also need to print something into Komodo output window. How can I do that?

Community
  • 1
  • 1
Pablo
  • 28,133
  • 34
  • 125
  • 215

1 Answers1

1

Use runEncodedCommand in a macro to print to the Komodo command output window:

komodo.assertMacroVersion(2);
if (komodo.view && komodo.view.scintilla) { komodo.view.scintilla.focus(); }

var foo = "echo " + typeof(ko);
ko.run.runEncodedCommand(window, foo); // Prints object;
Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
  • But this is JavaScript. I was looking to print from Python program. – Pablo Apr 05 '12 at 02:52
  • 1
    There's a [Python Macro API](http://community.activestate.com/forum/python-macro-access-command-output-window) that can print as well. I hope that helps. – Paul Sweatte Apr 05 '12 at 21:45
  • I came across that thread but unfortunately I can't use it due to error not finding `xpcom` module and I'm not sure how to install it. – Pablo Apr 08 '12 at 18:38
  • If you're running the code inside the console window, xpcom is not in that namespace. Try adding the macro to the [Toolbox](http://docs.activestate.com/komodo/6.1/macros.html#macros_writing) and assigning a key binding to run it while the console window is open. – Paul Sweatte Apr 13 '12 at 14:56
  • Running macro manually is not what I want. I need to print debug output from within program. – Pablo Apr 13 '12 at 15:43
  • A [similar question](http://stackoverflow.com/questions/1711193/) exists with an answer that may be acceptable. – Paul Sweatte May 08 '12 at 00:51