Python Scripts (Custom Scripts)
This page describes Revolution release 4.0.0.
On this page
5. Python Scripts (Custom Scripts)
Sidebar: Python Scripts · Role required: Read on Python Scripts (Execute to run, Write to edit; see §13.3)
Use the Python Scripts area when you need more than the ready-made workflow
steps. Here you can write small programs in Python (a popular, readable
programming language) that control devices, move labware and drive the system
directly. Scripts reach Revolution through revo, a Python library that
Revolution builds for your system: one function per workflow step, the commands
each of your devices offers, and revo.parameters to read and change the
schedule’s parameters. A script can run on its own from the editor, or be
dropped into a schedule as a single step, and revo works either way. A
schedule step can reach the parameters its schedule declares; a script run from
the editor has no schedule parameters, so it cannot use revo.parameters.
This area is aimed at method developers and power users. If you don’t write code, you can skip it. The page is a tabbed workspace (an Overview plus one tab per open script), and it warns you before you leave a script with unsaved changes.
5.1 Script library
Click Python Scripts in the sidebar to open the library. The page itself is headed Custom Scripts; both names refer to the same area.
The library is a folder/file explorer of all scripts, with columns for Script Name, Last Edited and Created At. Until a script or folder exists, the page shows No scripts yet. Create scripts and folders, rename scripts and folders with Rename in the row’s actions, delete items, and organise everything by drag-and-drop. Click Manage Files to move items between folders in a folder window, then click Done. Script names must be unique.
5.2 The script editor
A full code editor with Python colour-coding, line numbers, bracket matching,
search, undo/redo, and Ctrl/Cmd+S to save. As you type, the editor helps you
write correct code: it underlines mistakes, shows explanations when you hover, and
offers autocomplete suggestions. A script must be saved before it can run.
Finding your way around a script
The editor also helps you move around and change the names in a script. These work within the script you have open, in the script editor and in the code box of a Run Python step in a schedule:
| To | Do this |
|---|---|
| Jump to where a name is defined | Put the cursor on it and press F12, or Ctrl/Cmd-click it |
| See every place a name is used | Press Shift+F12; a panel lists each line. Click a line to go to it, and press Esc or × to close the panel |
| Rename a name everywhere in the script | Press F2, type the new name and press Enter (or Esc to cancel). One undo puts the old name back everywhere |
| See what a function expects | Type ( after its name; a tip shows its parameters, with the one you are typing in bold |
Resting the cursor on a name also highlights its other uses in the script. Holding
Ctrl (Cmd on a Mac) underlines the name under the pointer to show you can click
it to jump to its definition. If a
name is defined outside your script (for example in the revo library), the editor
shows Defined outside this script instead of jumping. You can’t rename while
the script is read-only. These helpers need the editor’s connection to your Revo
Core; while it is offline they do nothing.
If someone else has edited the same script since you opened it, a Save Conflict message lets you review the difference and choose whether to Force Save your version over theirs.
Ctrl/Cmd+S to save; a script must be saved before it can run, and the green run control at the top right starts it: a Script started. message confirms the run and the Executions tab opens on it. The side panel exposes the AI Assistant, Executions and Packages tabs for the open script.5.3 AI Assistant (write Python with AI), executions and packages
- AI Assistant (“Revo Intelligence”, code mode): describe a protocol in plain language and the assistant proposes Python for the open script. It can look up your devices, other scripts, past script runs and their logs, and schedules, as far as your tenant lets Ask Revo read them. Its edits appear in the editor as changes to review: accept or discard each one in-line, or all at once (with keyboard shortcuts). To ask about part of the script, drag down the gutter beside the line numbers to select those lines. A chip naming the selected lines appears above the message box, and your next message asks the assistant to change only those lines. Click the cross on the chip to clear the selection. The assistant never saves the script; click Save when you are happy. New Chat, or opening another script, starts a fresh conversation.
- Executions: a refreshable list of past and running script runs, each with a status pill (Running / Succeeded / Failed / Cancelled), timing, and a thread label. Open any run to see exit code, stderr count, a streamed log view, and a snapshot of the exact code that ran. The run list and the log scroll separately, so a long history does not push the log out of view. Copy log (the copy icon beside the run details) copies the run’s error message and log text to the clipboard as plain text, without line numbers or timestamps. For a log longer than 20,000 lines it copies the last 20,000, so the error at the end is included, and adds a line saying how many earlier lines were left out.
- Packages: search PyPI, view package details and versions, and add a package to your script. Packages must be approved before use: members with Write on Python Scripts submit an approval request with a business rationale; members with Write on Approve Script Packages approve a specific version or all versions (see §13.3).
![]() |
Generate code from a description. The AI Assistant tab runs Revo Intelligence in Script Mode: describe your protocol in plain language and it shows its edits in the editor for you to accept or discard. A banner confirms "Coding mode engaged", and the assistant notes that output is AI-generated and should be reviewed. Type your request in the message box at the bottom to get started. |
![]() |
Review past and live runs. The Executions tab lists every run of the script with a status pill such as Succeeded, the run timestamp and a thread label. The list refreshes so you can watch a run in progress. Open any entry to inspect its exit code, error count and the streamed log output, and use Copy log to paste the log into a support request or an email. |
![]() |
Add Python packages. The Packages tab lets you search PyPI from the Search PyPI box and review matches under Top Results. Select a package to view its details and versions and add it to your script. Packages must be approved before use, so members with Write on Python Scripts submit an approval request with a business rationale. |
5.4 Schedule parameters in Python steps
A Run Python or Run Python Script step reads and writes its schedule’s
parameters through revo.parameters. See Schedule parameters in Python in the
developer docs.


