One call.
Send code and input. The call returns the result. The sandbox ends with the run.
- Python 3.13 has numpy, pandas, pyarrow and more built in.
- A run that raises an error returns ok as false. The traceback is in the command output.
- A retry with the same key never runs the code twice.
const code = `
def run(input, config):
return sum(input)
`;
const run = await lbb.sandboxes.run({ code, input: [1, 2, 3] });
run.ok; // true when the code exited with code 0
run.result; // 6
run.command; // "cmd_…", the record of this runcode = """
def run(input, config):
return sum(input)
"""
run = lbb.sandboxes.run(code=code, input=[1, 2, 3])
run.ok # True when the code exited with code 0
run.result # 6
run.command # "cmd_…", the record of this run