How can I create a New Command or Macro in Komodo 7.1 IDE to save and run a python file?
I want the output to go to a New Console. Not the Command Output Tab.
If you put:
import code
code.interact(local=locals())
in your program, then you will be dumped to a python interpreter. (See Method to peek at a Python program running right now).
Use doCommand and runEncodedCommand to save and run the python file respectively:
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\'}');