Snapshot
Sandbox 使用
你可以直接从已有的 Snapshot 创建一个新的 Sandbox。新的 Sandbox 会从已捕获的状态启动——拥有相同的文件系统、内存与运行时状态,因此原始 Sandbox 中完成的准备工作可以直接使用。
最后修改于 2026年9月1日
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
from ppio_sandbox import PPIO
ppio = PPIO()
snapshot_id = "<snapshot_id>"
# 从之前捕获的 Snapshot 创建新的 Sandbox
new_sandbox = ppio.sandbox.create(snapshot_id)
# Snapshot 中捕获的状态已经就绪
result = new_sandbox.commands.run("python -c 'import requests; print(requests.__version__)'")
print(result.stdout)
new_sandbox.kill()
import { PPIO } from 'ppio-sandbox'
const ppio = new PPIO()
const snapshotId = '<snapshot_id>'
// 从之前捕获的 Snapshot 创建新的 Sandbox
const newSandbox = await ppio.sandbox.create(snapshotId)
// Snapshot 中捕获的状态已经就绪
const result = await newSandbox.commands.run("python -c 'import requests; print(requests.__version__)'")
console.log(result.stdout)
await newSandbox.kill()
ppio sandbox create <snapshot_id>