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.
/run [...]
: Executes a script or module. See more details here./execute [...]
: Same as/run
but without breakpoints. See more details here./restart
: Starts a fresh instance of the Python interpreter. See more details here./open <path>
(alias/edit
): Opens the given workspace-relative path in an editor./new [path]
: Creates a new file (optionally, with the given name)./mv <old path> <new path>
(alias/rename
): Renames the given workspace relative path./rm <path>
(alias:/delete
): Moves the given workspace relative path to the Trash.