[Go to Previous] [Go to Next]


Jython Shell
The Jython Shell is an interactive command line interface to the McIDAS-V Jython interpreter that allows the user to type in arbitrary Jython to evaluate. This feature is brought up with the Tools->Formulas->Jython Shell menu item in the Main Display window. Alternatively, the Jython Shell can be brought up with Ctrl+J.
The User Interface
Image 1: Jython Shell Window
Image 1: Jython Shell Window

The Jython shell consists of an output window on the top and an input field on the bottom. The user enters Jython into the input field. When Enter or Evaluate button is pressed the Jython is evaluated and any output is shown in the output window. Note that Enter will only evaluate the field if the field has not been expanded. If your are using multi-line input for your commands, you can evaluate the commands with Shift+Enter.

The entry window can be expanded with the Jython Expand double down arrows to the right of the command line. When the entry field is expanded, you can enter more than one line of code to be processed at once. When the entry field isn't expanded, you are limited to evaluating one line of code at a time. As an alternative to the Jython Expand double down arrows button, you can use Ctrl+/ to change between single and multi-line command line structure.

Pressing the "Up" arrow and "Down" arrow in the entry field goes up and down through the history of commands when you are in single-line input. If you are using multi-line input, use Ctrl+P, Ctrl+N to cycle through previously-executed commands.

After a command has been evaluated, the command will be listed above the Evaluate field. To the right of the command, there are two buttons. The Down Arrow button button enters the formula back into the Evaluate field without evaluating it. The Reevaluate button button reevaluates the previously entered command without having to manually reenter it.

The Jython Shell window includes syntax highlighting, which colors different parts of the text in different colors. For example, strings will be pink and comments specified with a pound symbol (#) will be green. This syntax highlighting is only available in multi-line input mode. When in multi-line input mode, pressing enter will restore the indentation of the previously-entered line. For example, when setting up the addeParms dictionary in the image above, when Enter was pressed after line three, the indentation of four spaces was automatically applied for line four.

Print statements are not needed in the Jython Shell to output information when a single line of code is being evaluated. Below are a couple of examples:

Right-clicking in the entry field brings up a menu that allows for:

Menus

All of the menu items in this tool are unique to the Jython Shell.

The File menu has these unique items:

The Edit menu has these unique items:


[Go to Previous] [Go to Next]