The Workbench Scripting Shell is primarily used for running Python or Lua scripts,
or typing commands in these languages directly. However, you can
also use it to access the Workbench Scripting Shell Scripting Library functions and
global functions and objects. To see the available commands,
?”. You can also cut and
paste text to and from the shell window.
The Snippets tab is a scratch pad for saving code snippets. This makes it easy to reuse code and does away with the need to retype it at the command line.
If you have opened script files, each will have its own tab to
the right of the Snippets tab. These tabs
will be labeled with the names of the script files, or
Unnamed for snippets without a name. As with
the Snippets tab you can cut and paste to
or from any of the tabs. This gives you the opportunity to test
code from the command line. Right clicking on a snippet opens a
dialog with options to Execute Snippet,
Send to Script Editor, or Copy To
While individual commands can be entered into the shell, it is also possible to run a longer script, stored in an external file, using the main menu item Scripting, Run Workbench Script File. When scripts are run outside of the shell, to see the output use the main menu item View, Output.
It is also possible to run script files directly from the shell. For details on running script files, type ? run at the Workbench Scripting Shell prompt. The following message is displayed:
Help Topics ----------- grt General information about the Workbench runtime scripting Practical information when working on scripts and modules for Workbench wbdata Summary about Workbench model data organization modules Information about Workbench module usage plugins Information about writing Plugins and Modules for Workbench Type '? [topic]' to get help on the topic. Custom Python Modules --------------------- grt Module to work with Workbench runtime (grt) objects grt.root The root object in the internal Workbench object hierarchy grt.modules Location where Workbench modules are available grt.classes List of classes known to the GRT system mforms A Module to access the cross-platform UI toolkit used in some Workbench features wb Utility module for creating Workbench plugins Type 'help(module/object/function)' to get information about a module, object or function. Type 'dir(object)' to get a quick list of methods an object has. For an introductory tutorial on the Python language, visit http://docs.python.org/tutorial/ For general Python and library reference documentation, visit http://python.org/doc/
Within the Workbench Scripting Shell, there are four tabs on the top of the left side panel: Files, Globals, Classes, and Modules. Discussion of these additional tabs follows.
An exception is thrown while attempting to use
input() or read from
Copyright © 2006, 2014, Oracle and/or its affiliates. All rights reserved. Legal Notices