How can I run the first Python program in Komodo Edit 8.5?
Asked Answered
S

4

7

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

Synodic answered 10/2, 2014 at 19:40 Comment(0)
I
6

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

Isopropyl answered 10/2, 2014 at 22:34 Comment(3)
dont forget to run some programs with %(python) -u "%F" the -u allows you to use the unbuffered mode because sometimes you cant see the result in the console, so with this mode you can.Contrastive
Just to add to Abdelouahab's comment, I needed to run some short programs interactively, that solution enables you to enter inputs and see the outputs direct in a console (a tab at the bottom for me).Trickery
Can this be extended so that the code is saved before running?Langham
P
3

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

Poirer answered 28/1, 2018 at 17:9 Comment(0)
S
2

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

%(python) %F
Strait answered 5/2, 2016 at 1:20 Comment(0)
R
0

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

Ruy answered 27/1, 2021 at 3:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.