Feature Showcase - Using the Interactive Shell

(Komodo IDE only)

Press F12 (‘Command’+‘Esc’ on macOS) to switch between the Editor Pane and the interactive shell. This showcase uses the sample program preprocess.py, described in the Python tutorial, located by default in install dir\Komodo x.x\samples\python_tutorials.

Before you start: Configure the interactive shell preferences to load the Python shell by default.

The key bindings mentioned below are part of the default Windows/Linux key binding scheme. If you are using Komodo for macOS, click Help > List Key Bindings to view the equivalent macOS key bindings.

  1. On line 67 of preprocess.py, select and copy contenttype.

  2. Press F12 (‘Command’+‘Esc’ on macOS) to open the shell. Enter import and press Ctrl+V to paste contenttype, and then press ‘Enter’ to load the module.

  3. On the new line, enter help (, press Ctrl+V again to paste contenttype. and add a period.

  4. Press F12 (Command+Esc on macOS) to switch back to the Editor Pane, and select and copy getContentType on the same line as contenttype.

  5. Press F12 (Command+Esc on macOS) to switch back to the interactive shell. Press Ctrl+V to paste getContentType, then enter a closing parenthesis and press ‘Enter’.