技能 python-executor
🐍

python-executor

低风险 ⚙️ 外部命令🌐 网络访问

在沙盒环境中执行 Python 代码

也可从以下获取: skillssh,inference-sh-skills,inferen-sh,infsh-skills,inference-sh-9,inference-skills,inference-sh

配置带有专用库的 Python 环境需要花费时间和精力。本技能可通过简单的 CLI 命令在远程沙盒中运行 Python 代码,预装 100+ 库。

支持: Claude Codex Code(CC)
📊 71 充足
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“python-executor”。 在沙盒中运行 print('Hello, World!')

预期结果:

Hello, World!

正在使用“python-executor”。 根据销售数据生成柱状图并保存到 outputs/

预期结果:

图表已保存!输出文件:outputs/chart.png(PNG 图像,480x360 像素)

正在使用“python-executor”。 抓取 https://api.github.com/users/octocat 并打印 JSON 响应

预期结果:

包含用户资料数据的 JSON 响应,包括 login、id、avatar_url 和 public_repos 等字段,并进行缩进格式化

安全审计

低风险
v1 • 6/16/2026

This skill is a documentation-only skill that describes how to invoke the inference.sh Python execution service via the belt CLI. The static analyzer flagged 70 patterns, but all are false positives: 'Ruby/shell backtick execution' findings are Markdown formatting for code spans (e.g., `belt login`), 'Python HTTP libraries' are example code shown in documentation, 'Hardcoded URL' findings are legitimate service URLs and example endpoints, and the 'Weak cryptographic algorithm' and 'Network reconnaissance' findings are triggered by the words 'safe' and 'isolated subprocess' with no actual crypto or network recon code present. The allowed-tools is narrowly scoped to Bash(belt *) and code execution occurs remotely in inference.sh's sandbox, not locally. No prompt injection, data exfiltration, or malicious intent detected.

1
已扫描文件
188
分析行数
4
发现项
1
审计总数
低风险问题 (2)
External network access required for service invocation
The skill invokes the inference.sh Python execution service, which requires network connectivity. All code execution occurs in inference.sh's remote sandbox; the local machine only sends code to the API and receives results. This is the intended and documented behavior of the skill.
Bash command execution via belt CLI
The skill uses Bash(belt *) to invoke the belt CLI, which calls the inference.sh service. The allowed-tools is narrowly scoped to belt commands only, preventing arbitrary shell execution. This is the documented mechanism for using the skill.
审计者: claude

质量评分

38
架构
100
可维护性
87
内容
50
社区
86
安全
91
规范符合性

你能构建什么

网页抓取与数据提取

使用 BeautifulSoup 或 Selenium 从网站提取数据,然后将结果保存到文件。非常适合研究和数据收集任务。

带可视化的数据分析

使用 Pandas 处理数据集,并使用 Matplotlib 或 Plotly 创建图表。输出文件会自动从沙盒返回。

媒体处理与生成

使用 PIL 处理图像,使用 MoviePy 制作视频,或使用 trimesh 处理 3D 模型。所有输出文件都会被自动捕获。

试试这些提示

运行简单的 Python 脚本
在沙盒中运行以下 Python 代码:print('Hello, World!')
抓取网页并提取标题
使用 python-executor 抓取 https://example.com,并使用 requests 和 BeautifulSoup 打印页面标题。
根据数据创建柱状图
使用 python-executor 创建一个展示销售数据的柱状图:Alice 有 100 单销售,Bob 有 150 单。将图表保存到 outputs/chart.png。
生成带文字叠加的视频
使用 python-executor 创建一个 3 秒的视频,蓝色背景上显示白色文字"Hello!"。使用 MoviePy 保存到 outputs/hello.mp4,超时时间设为 120 秒。

最佳实践

  • 将输出文件保存到 outputs/ 目录,以便自动从沙盒返回
  • 使用 plt.savefig() 而不是 plt.show(),因为沙盒是非交互式的
  • 对于超过默认 8GB 限制的大型数据集,请使用 high_memory 变体(16GB RAM)

避免

  • 不要尝试安装包 - 只能使用 100+ 预装库
  • 避免运行超过 300 秒超时限制的长时间脚本
  • 不要使用 plt.show() 或其他交互式显示函数 - 沙盒无法显示它们

常见问题

沙盒中使用的是什么 Python 版本?
Python 3.10,运行在仅限 CPU 的环境中,默认 8GB RAM。
可用内存是多少?
默认 8GB。对于处理大型数据集,可使用 high_memory 变体获得 16GB RAM。
我可以安装额外的 Python 包吗?
不可以。沙盒包含 100+ 预装库,如 NumPy、Pandas 和 Matplotlib,但您无法添加新包。
输出文件如何返回给我?
保存到 outputs/ 目录的文件会被自动检测并在响应中返回。
机器学习是否有 GPU 支持?
不支持。这是仅限 CPU 的环境。对于需要 GPU 加速的机器学习工作负载,请使用专门的 AI 应用。
每个脚本的最长执行时间是多少?
最长 300 秒。默认超时为 30 秒,您可以根据每次执行进行调整。

开发者详情

文件结构

📄 SKILL.md