360 Secure SkillHub
360 安全技能中心

Python Cookbook

内置常见 Python 代码片段(文件读写、json、列表、装饰器、异步、正则、日期等),支持按关键词搜索;可通过 bash 脚本执行代码片段或文件、用 py_compile 检查语法、用 black 或 autopep8 格式化文件,并查询常见错误的解决方案。

loutai0307-prog
loutai0307-prog
热度 68.34
最近更新 2026-05-11 17:43:55
分类:开发依赖:代码执行 / 读写文件应用场景:代码生成 / 代码审查 / 调试排错

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add python-cookbook
Metadata
name
python-cookbook
description
Python code patterns and recipes for everyday tasks. Use when you need file I/O snippets, list comprehensions, decorators, async functions, regex patterns, datetime handling, or need to lint and format Python files.

python-cookbook

Triggers on

python snippet, python code pattern, file io python, list comprehension, decorator, async python, python regex, debug python, lint python, format python

What This Skill Does

Search and display common Python code recipes, run code snippets, check syntax, auto-format files, and look up solutions for common Python errors.

Commands

snippet

Search or browse built-in code snippets (file-read, file-write, json, list, dict, decorator, async, regex, date, and more).

bash scripts/script.sh snippet [keyword]
bash scripts/script.sh snippet decorator

run

Execute a Python code snippet inline or from a file.

bash scripts/script.sh run 'print("hello world")'
bash scripts/script.sh run @script.py

lint

Check Python file syntax using py_compile.

bash scripts/script.sh lint <file.py>

format

Auto-format a Python file using black (falls back to autopep8).

bash scripts/script.sh format <file.py>

debug

Show solutions for common Python errors (NameError, TypeError, IndexError, etc.).

bash scripts/script.sh debug [ErrorName]
bash scripts/script.sh debug TypeError

help

Show all available commands.

bash scripts/script.sh help

Requirements

  • bash 4+
  • python3 (standard library)
  • black or autopep8 (optional, for format command)

Powered by BytesAgain | bytesagain.com