Safe Local Python Executor/Interpreter

by maxim-saplin
Verified

run_python

Run and test Python code securely in a sandboxed environment with restricted imports. Execute calculations, data manipulations, and return results with logs for debugging.

Instructions

Execute Python code in a secure sandbox environment.

This tool allows running simple Python code for calculations and data manipulations. The execution environment is restricted for security purposes. Make sure you create a single file that can be executed in one go and it returns a result. Default allowed imports: - math - random - datetime - time - json - re - string - collections - itertools - functools - operator Args: code: The Python code to execute. Must be valid Python 3 code. The result must be stored in a variable called `result`. E.g.: ```python import math result = math.sqrt(16) ``` Returns: A dictionary with execution results containing: - result: The final value or None if no value is returned - logs: Any output from print statements

Input Schema

NameRequiredDescriptionDefault
codeYes

Input Schema (JSON Schema)

{ "properties": { "code": { "title": "Code", "type": "string" } }, "required": [ "code" ], "title": "run_pythonArguments", "type": "object" }

You must be authenticated.

Other Tools from Safe Local Python Executor/Interpreter

Related Tools

ID: cj2uey3ghu