Skip to main content

list_live_sessions

List the session IDs of the ESPlotter Desktop windows open on this computer.

Use it before live(...) to find the window to control: when exactly one window is open, connect to it directly; when several are open, ask the user which one, since only they know which window holds their work. They can copy a window's ID from Help > Version > Copy session ID. Windows of a Desktop that is no longer running are left out.

Signature​

list_live_sessions() -> list[str]

Example​

import os
import sys

# Load the ESPlotter module supplied by ESPlotter Desktop on Windows.
sys.path.insert(0, os.path.join(os.environ["APPDATA"], "ESPlotter", "python-sdk"))
import esplotter as esp

sessions = esp.list_live_sessions()
if len(sessions) == 1:
with esp.live(session_id=sessions[0]) as workspace:
print(workspace.version)