用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/fabioc-aloha/Alex_Skill_Mall --skill temp-file-python-analysis命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | temp-file-python-analysis |
| description | Inline Python in shell scripts has quoting issues: |
| lastReviewed | 2026-04-30T00:00:00.000Z |
Inline Python in shell scripts has quoting issues:
# Fails with quote escaping problems
python -c "import pandas as pd; df = pd.read_csv('data.csv'); print(df[df['name'] == 'John'])"
# Even worse with complex logic
python -c "
import json
with open('config.json') as f:
data = json.load(f)
for item in data['items']:
if item['status'] == 'active':
print(item['name'])
"
Write to _tmp.py, execute, delete:
# Write script
cat > _tmp.py << 'EOF'
import pandas as pd
df = pd.read_csv('data.csv')
result = df[df['name'] == 'John']
print(result.to_json(orient='records'))
EOF
# Execute
python _tmp.py
# Clean up
rm _tmp.py
$script = @'
import pandas as pd
df = pd.read_csv('data.csv')
print(df.describe().to_string())
'@
$script | Out-File -FilePath "_tmp.py" -Encoding utf8
python _tmp.py
Remove-Item "_tmp.py"
| Approach | Quoting Issues | Debugging | Editor Support |
|---|---|---|---|
Inline -c | Many | Hard | None |
| Heredoc | Some | Medium | Limited |
| Temp file | None | Easy | Full |
cat > _tmp.py << 'EOF'
import pandas as pd
import sys
df = pd.read_csv(sys.argv[1])
print(f"Rows: {len(df)}")
print(f"Columns: {list(df.columns)}")
print(df.dtypes)
EOF
python _tmp.py data.csv
rm _tmp.py
cat > _tmp.py << 'EOF'
import json
with open('input.json') as f:
data = json.load(f)
# Transform
result = [item for item in data if item.get('active')]
with open('output.json', 'w') as f:
json.dump(result, f, indent=2)
EOF
python _tmp.py
rm _tmp.py
data python shell analysis