用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/HKUDS/OpenSpace --skill python-execution-fallback-9d4989命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Incremental audio production with duration mismatch handling, adaptive stem extension, and pre-mix alignment verification
Audio production with diagnostic analysis, timecode parsing from documents, and verified export workflow
Incremental audio production with duration alignment handling, per-stem verification, and adaptive extension strategies
基于 SOC 职业分类
正在显示 SKILL.md
| name | python-execution-fallback-9d4989 |
| description | Fallback method for executing Python when execute_code_sandbox fails with unknown errors |
Use this skill when execute_code_sandbox returns 'unknown error' or fails unexpectedly, even on simple Python code like print statements.
Switch to using run_shell with Python heredoc syntax instead of execute_code_sandbox.
python3 << 'EOF'
# Your Python code here
print("Hello World")
result = 2 + 2
print(f"Result: {result}")
EOF
Instead of:
execute_code_sandbox(code="print('Hello')")
Use:
run_shell(command="python3 << 'EOF'\nprint('Hello')\nEOF")
For multi-line code, build the command string:
code = """
import json
data = {"status": "ok", "count": 42}
print(json.dumps(data))
"""
run_shell(command=f"python3 << 'EOF'\n{code}\nEOF")
run_shell executes commands directly in the shell environment, bypassing sandbox issues<< 'EOF') allows clean multi-line Python code without complex escaping'EOF') to prevent variable expansion.py file first, then executing:
run_shell(command="python3 /path/to/script.py")
# Step 1: Try execute_code_sandbox
try:
result = execute_code_sandbox(code="print(2+2)")
except Exception as e:
# Step 2: Fallback to run_shell with heredoc
result = run_shell(command="python3 << 'EOF'\nprint(2+2)\nEOF")
# Parse stdout to get the output
output = result.stdout.strip()
| Issue | Solution |
|---|---|
| Python not found | Use which python3 to verify installation |
| Heredoc not working | Ensure single quotes around EOF delimiter |
| Complex imports fail | Install required packages or write to .py file |
| Output not captured | Check run_shell stdout, not return value |