REPL
Scripton includes a special Python REPL —
You can display it by either using its keyboard shortcut CTRL
+ `
(backtick) or clicking on the REPL button in the toolbar:
Exceptions
When your program encounters an exception, its details are displayed in the REPL —
The traceback rows corresponding to library code are dimmed. The arrow in the margin indicates the deepest call that's still within your workspace code.
Click on a location in the exception traceback to automatically open it in an editor.
Click on the chevron/arrow next to the exception title to collapse/expand the traceback.
Folding
Hovering over the left edge of an execution output will reveal the folding indicators. Click anywhere on the left edge to collapse the output.
Multi Line Mode
Single Line — By default, entering a complete single line Python statement and hitting
Enter
will cause Scripton to execute it immediately.Auto New Line — If you enter a statement that unambiguously needs more input, Scripton will auto-detect it and move the text cursor to the next line. For instance, starting a new block:
Or, an unclosed parenthesis:
Manual New Line — You can always explicitly insert a new line by pressing
Shift
+Enter
:Once you're in multi-line mode, press
Enter
twice to execute.
Output Colors
Scripton uses distinct default colors for output written to stdin
, stdout
, and the evaluation result as shown in the figure below.
Search
You can search for text within the REPL by bringing up the REPL search bar. Its default shortcut is ⌘
+ Option
+ F
. Alternatively, right click anywhere in the REPL and select Find
.
Special Commands
The REPL supports a small set of "special commands" that are interpreted as instructions to the IDE instead of Python Code. A subset of these are described below.
The /run
command
When used without any arguments, the
/run
command executes the currently active execution target (displayed at the center in the toolbar). The resolved execution target is also specified near the right edge —An optional argument may specify a Python script path. This may either be a workspace relative path:
/run tools/plot_confusion_matrix.pyor an absolute path:
/run /Volumes/work/tau_zero/accelerate.pyArguments may be passed to the script by specifying them after the path:
/run visualize_depth_map.py --src /data/primesense --tag "version 2"The propagated arguments match the Python standard library's
shlex.split
parsing.
The /execute
command
This is nearly identical to the /run
command, with the sole exception that all breakpoints are disabled for this execution. This provides a quick way to run the script without any debugging overhead.
The /restart
command
Starts a fresh instance of the Python interpreter. You typically don't need to do this as Scripton will automatically start a new instance for each script run (as described in more detail in the execution section)