Scripton / Docs

Execution

Execution Target

Scripton displays the active execution target in the toolbar:

  • This is the script that will be run by default when you either click on the button in the toolbar, press + R, or enter /run in the REPL.

  • By default, Scripton automatically switches the current execution target to the currently focused script tab. If, instead, you want to fix/freeze the execution target to a particular script, you can do so by clicking on the Pin button next to it.

  • Alternatively, you can also run and pin scripts by right clicking on their tab and using the context menu.

  • The toolbar dropdown lets you quickly access recently run scripts.

Auto Python Relaunch

Scripton automatically launches new instances of the Python interpreter process —

  • If you're entering code in the REPL, the last launched Python interpreter and its state is used. This is similar to how the standard Python REPL (or Python Notebooks) behave.

  • Whenever you run a script, a new Python process is automatically created and used. This is similar to launching a Python script from a terminal. This guarantees no state creeps across executions (unlike, say, Python Notebook cell executions).

  • In the figure above, note that when a script finishes running, it leaves the Python process alive until the next script execution. This allows the REPL to interact with any global state available after execution.

  • If desired, you can always manually restart the Python interpreter from the REPL by using the /restart special command.

Iterrupting Execution

  • You can interrupt execution via the keyboard shortcut CTRL + C, or by clicking the Stop button in the toolbar:

  • The initial request to stop execution transmits a SIGINT signal to the Python process (typically raised as a KeyboardInterrupt exception in Python). If for any reason the Python process is unresposive to this initial interruption attempt, Scripton enables more drastic measures after a brief delay. This is indicated by the stop button switching to an axe icon as shown below. Interruption attempts after this point transmit a SIGKILL signal.