Komodo IDE is among the many great IDEs for writing Python code. Here, we'll go through how to customize it for essential everyday development. The demos will focus on macOS.
1. Download and install the IDE.
Download Komodo IDE
2. Launch the IDE.
3. Go to "Preferences.."
You can do this by either going to Komodo > Preferences... or choosing Preferences in the middle of the start screen that appears when you launch the IDE.
In order to make the IDE make use of Python 3's unicode compliance, we need to adjust the settings for Internationalization.
On the left pane of the Preferences dialog, select Internationalization; the available options will pop to the right pane.
-> Under Default Editor Encoding section, change Default encoding to UTF-8
-> Under Language-specific Default Encoding section, change both Python & Python 3 options to UTF-8
-- Python: UTF-8 -- Python 3: UTF-8Note: After making appropriate selections in both dropdown menus, e.g. Python & UTF-8 respectively, click Apply (bottom right of window) for changes to take effect before moving to the next setting since it's the same boxes you use for all settings in this area.
4. Open a sample project (folder) with some python files.
To ease the next set of settings, we need to have a sample project open in the editor.
-> On the left pane of the IDE, click on the little gear icon and choose Open Directory...
-> Follow the on-screen prompts to locate & open a directory on your computer that contains python files.
5. Adjust script execution settings
- Open right-side pane.
- right-click or control-click in an empty space (right pane)
- In the pop up menu that appears, choose "Add > New Command..."
- In the command box of "Add Command" window, type this exactly as is: `env LANG=en_US.UTF-8 "%F"`. This makes the IDE handle unicode characters properly.
- In the box just above the `command` box, type a title for the command; let's choose 'Run - R`
-> Go to "Advanced Options" tab.
-- In the 'start in' box, click on the arrow to the right and select "%D: directory path of file".
-> Go to "Key Binding" tab.
-- in "New Key Sequence" field, press "Command + Shift + R" (on the keyboard) and click "Add" to the right to add it to "Current Key Sequence"
-> Click "OK" to save the settings.
You can see that our command title "Run - R" appears in the right pane.
Open one of the files in the directory you opened earlier and press the keyboard shortcut we set up earlier "Cmd+Shift+R". If all went well, then you will see the output of your script in the command Output window at the bottom of the IDE.
And we're done :)