You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interpreter outputs are auto-formatted and returned in multiple formats:
116
-
117
-
- text
118
-
- html (e.g., Pandas tables)
119
-
- png, svg (e.g., Matplotlib charts)
120
-
- json (structured data)
121
-
- chart (parsed visualizations)
122
-
123
-
```ts
124
-
const result =awaitsandbox.runCode(
125
-
`
126
-
import seaborn as sns
127
-
import matplotlib.pyplot as plt
128
-
129
-
data = sns.load_dataset("flights")
130
-
pivot = data.pivot("month", "year", "passengers")
131
-
sns.heatmap(pivot, annot=True, fmt="d")
132
-
plt.title("Flight Passengers")
133
-
plt.show()
134
-
135
-
pivot.to_dict()
136
-
`,
137
-
{ context: pythonCtx },
138
-
);
139
-
140
-
if (result.png) {
141
-
console.log("Chart output:", result.png);
142
-
}
143
-
```
144
-
145
156
Sandboxes are still experimental. We're using them to explore how isolated, container-like workloads might scale on Cloudflare — and to help define the developer experience around them.
0 commit comments