Skip to main content
Run Python code in an isolated container.

Description

The run-python prompt provides a simple way to execute Python code in a container. It handles image selection and provides clear instructions for the execution.

Parameters

Generated Instructions

When invoked with:
Returns:
Use run with tag:python:3.11-slim image. If the image doesn’t exist, import it first.

Multi-line Script

With Package Usage

Note: If the code requires packages not in the base image, you’ll need to install them first using install-packages or prepare-environment.

Implementation Notes

The agent should:
  1. Check if tag:python:3.11-slim exists with list_images
  2. If not found, import it with import_image
  3. Execute the code with run:

See Also