Domanda

I'm learning Python for the first time and I use Komodo Edit 8.5 to practice Python.

But I don't know how to run a program in Komodo Edit.

How can I do that?

Enter image description here

È stato utile?

Soluzione

There is no debugging feature in Komodo Edit but you can just run the current file by creating a Run Command:

  1. go to Toolbox -> Add -> New Command...
  2. in the top field enter the name 'Run Python file'
  3. in the 'Command' field enter this text:%(python) %F
  4. (optional) click on the 'Key Binding' tab and assign a key command to this command
  5. click Ok.

You should now have a new Run Command in your toolbox called 'Run Python file'; when you double-click on it the command should run the current Python script open in the editor and display the output in the Command Output pane.

For more on Run Commands:

http://aspn.activestate.com/ASPN/docs/Komodo/4.2/komodo-doc-run.html#run...

Altri suggerimenti

Although the 2014 answer is still a useful indication of what to do, Komodo has moved on. It's now at version 11. Assuming you're using Python 3 here are more detailed steps, for Windows.

Within Komodo, click on the three horizontal bar icon in the upper right corner and select 'Preferences'. Then select 'Python 3'. Komodo will offer you a drop-down menu of the Python 3 interpreters available on your system. Select one.

preferences

Within Komodo again, click on the horizontal bar icon again and select 'Run Command'. Enter %(python) %F, as shown, and select the 'Add to Toolbox' box, so that you can re-use the command.

run

You should now see this display. Komodo will have executed your code, and it will have added your command to the toolbox. It appears twice in mine because I was writing this!

display

Press Ctrl + R (Cmd + R on Macs) and enter:

%(python) %F

The first thing you should do is to link the Python3 Komodo option to your install python 3 executable file. Secondly, make sure that the Komodo Interactive Shell point out to Python 3 instead of Python (by default). Finally, create a command:

py "%F"

Note that you can rename it to "Run - Python". Also, make sure that you provide the create command with a key binding mine is Ctrl + Alt + R

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top