How-to

How to put a live Python script on a Stream Deck key

A Stream Script keeps running and prints a line whenever the key should change. Describe the key and let an AI agent write the script, or follow the printed-line rules yourself.

Platform
Windows, macOS
Stream Deck software
7.6 or later

Requirements

Operating system
Details: Windows 11 (64-bit, Intel/AMD) or macOS 13+
Stream Deck software
Details: Stream Deck software 7.6 or later

Steps

The info bar shows the result of an agent-written script: release-watch.py reading build 4812 passed
  1. Install the plugin (Arise Python Commander setup), then drag Stream Script onto a key or a Neo info bar.

  2. In the inspector, expand "Ask an AI agent to build this".

  3. Under Description, say what the key should show, for example "the temperature outside, blue when it's below freezing".

  4. Press Copy prompt. The prompt holds the script rules, the key's size and the delivery steps, never your push token.

  5. Paste into a same-computer agent that can read files and open links, such as Claude Code.

  6. Your agent can write, test and deliver through local push. Success depends on capabilities and data access. Delivery stores an inline copy.

  7. Press the key once. It shows live, then each printed line. An info bar starts without a press.

What a Stream Script prints

Print one short line per update. "Show example Python stream" in the inspector opens a working script.

print("...", flush=True)
Effect: Use flush=True or sys.stdout.flush() for timely lines. Otherwise Python may buffer output until later or process exit.
Plain text
Effect: Becomes the value, such as ok or 23.5 degrees. A line equal to Match value 1 or 2 shows its image.
progress:42|Syncing, progress=42, 75% | Uploading
Effect: A bar, percent clamped to 0 to 100.
A data:image/... URI, raw <svg> markup or JSON {"image": "..."}
Effect: Paints the whole surface: 144x144 on a key, 232x50 on the info bar.
layout=radial; or color=orange; before a line
Effect: Picks the layout (Auto detect only) or recolours that update. On the info bar, color=0:#ff0000,1:#0000ff; fills the bar.
Anything on stderr
Effect: Turns the key red. Log diagnostics to a file.
The script ends
Effect: Shows "done" (no output) or "ended" (had output). On a key, a press restarts it.

Script Canvas: paint the key yourself

A Python script paints a pixel-art flower on one key and a row of five flowers across the Neo info bar
  • Every printed line is one frame: a data:image/... URI, raw <svg> markup or JSON like {"image": "...", "title": "..."}.
  • Give an SVG a width and height, or the plugin takes the viewBox size, else 144x144.
  • The script starts when the key appears. Other lines are ignored, so debug prints vanish.
  • The plugin writes {"event": "ready"} to stdin at start and {"event": "keyDown"} on each press. Reading is optional.
  • stdin blocks: read it on a background thread and keep printing frames from the main loop.
  • If the script exits, the key shows stopped and a press restarts it. Anything on stderr shows an error.

Troubleshooting

The key stays on "live" and never updates.
Likely cause: Output may be buffered instead of reaching the plugin promptly.
Fix: Use flush=True on every print, or call sys.stdout.flush().
The key shows "done" or "ended" at once.
Likely cause: The script exited.
Fix: Keep it in a loop.
The key shows an error, but the script works.
Likely cause: Something was written to stderr, even a harmless warning.
Fix: Log diagnostics to a file instead.
An inline script cannot find its files or imports.
Likely cause: __file__ points to the temporary script, not the project. Relative paths use the plugin's working directory; project files/modules aren't copied.
Fix: Use absolute paths; file-based scripts can locate project files through __file__.
The agent cannot deliver the script.
Likely cause: A chat in the browser can write a script but cannot place it on the key.
Fix: Paste the script into "Script text" yourself, or use an agent that runs on this computer.

Still stuck? Contact us

Next steps

Arise Python Commander

  • Windows, macOS
  • 7.6 or later

Still stuck? Contact us