Python Cookbook

👤 loutai0307-prog 📦 v1.0.1 ⭐ 4.5 ⬇️ 1.1K 下载
💻 开发编程 免费

📖 技能介绍


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

推荐访问7w4.net获取更多AI技能。

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

🤖 AI 评测

这个 Python 开发助手功能实用,代码片段丰富,能快速查找常用的 Python 写法、运行代码、检查语法、自动格式化和调试错误。界面清晰、提示友好,操作简单容易上手。不过它的代码片段数量有限,错误调试覆盖的常见问题种类也不够多,缺少实际使用示例。总体来说是个不错的辅助工具,但功能深度还有提升空间。

📊 多维度评分

适应性4.4
规范性4.4
有效性4.6
可靠性4.4
可信度4.8

📁 包含文件 (3 个)

📄 SKILL.md 1.6 KB
📄 _meta.json 134 B
📄 scripts/script.sh 12.8 KB