Feature

Multi-Language Execution

Execute Python, JavaScript, Bash, and Go with full system access. Switch languages on the fly within the same sandbox.

multi_language.py
1from hopx_ai import Sandbox
2
3sandbox = Sandbox.create(template="code-interpreter")
4
5# Run Python
6python_result = sandbox.run_code("""
7import pandas as pd
8df = pd.DataFrame({'a': [1,2,3], 'b': [4,5,6]})
9print(df.describe())
10""", language="python")
11
12# Run JavaScript
13js_result = sandbox.run_code("""
14const data = [1, 2, 3, 4, 5];
15const sum = data.reduce((a, b) => a + b, 0);
16console.log(`Sum: ${sum}`);
17""", language="javascript")
18
19# Run Bash
20bash_result = sandbox.run_code("""
21echo "System info:"
22uname -a
23df -h
24""", language="bash")
25
26print(python_result.stdout)
27print(js_result.stdout)
28print(bash_result.stdout)

Supported Languages

Full runtime environments with package managers and system access

🐍

Python

Full Python 3.x with pip, virtualenv, and common data science libraries

JavaScript

Node.js runtime with npm, yarn, and ES modules support

💻

Bash

Full shell access with common Unix utilities and tools

🔵

Go

Go compiler and runtime for high-performance applications

One Sandbox, Many Languages

Execute code in any supported language with a single API call.