windows-print-image

在 Windows 上通过调用 mspaint /pt 使用 Python 打印图片,解决 bash 下中文路径编码问题的场景。

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "windows-print-image":https://skillpi.com/zh/skills/deepskill-98cb13a6480362be8bc1a79f796f263499aaaabb0e3514bea7bc229d40748ee0。安装前核对上游来源和版本:https://skillhub.cn/skills/user_6da1df82/windows-print-image。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

skillhub.cn

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

在 Windows 上通过调用 mspaint /pt 使用 Python 打印图片,解决 bash 下中文路径编码问题的场景。

0 下载

介绍来源: third_party · user_6da1df82 · 1.0.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: windows-print-image
description: Print images on Windows via mspaint /pt using Python — bypasses bash Chinese path encoding issues.
category: productivity

Windows Print Image

Print an image file to a specified printer on Windows. Uses Python subprocess + mspaint /pt to avoid bash/git-bash Chinese path encoding problems.

Trigger

  • User asks to print an image/file
  • User mentions printing something on Windows

Steps

1. Confirm file exists

python -c "import os; print(os.path.exists(r'<absolute_path>'))"

2. List available printers (optional)

powershell -Command "Get-Printer | Select-Object Name, PrinterStatus | Format-Table -AutoSize"

Check default printer:

powershell -Command "(Get-WmiObject -Query 'SELECT * FROM Win32_Printer WHERE Default=True').Name"

3. Print the image

python -c "import subprocess; img = r'<absolute_path>'; prn = '<printer_name>'; subprocess.run(['mspaint', '/pt', img, prn])"

Critical: Use Python raw strings (r'...') for paths — this is what makes it work! Bash's cmd /c mspaint /pt fails with Chinese paths due to encoding corruption, but Python's raw strings preserve the exact bytes.

Example

python -c "import subprocess; img = r'E:\私域相关资料\南京泊宁资料\8888.jpg'; prn = 'Canon G3000 series Printer (副本 1)'; subprocess.run(['mspaint', '/pt', img, prn])"

Pitfalls

  • Do NOT use cmd /c mspaint /p or cmd /c mspaint /pt from bash — Chinese path encoding gets mangled.
  • Do NOT use powershell Start-Process -Verb Print — it pops up a dialog requiring manual confirmation.
  • Always use Python r'...' raw strings for paths.
  • mspaint /pt takes: mspaint /pt <filename> <printername> — just 2 params is enough, no need for driver/port.

Verification

  • returncode: 0 = print job sent successfully.
  • Check the printer's physical output tray.

当前收录版本

1.0.0

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值75/100

亮点

  • 解决Windows环境下中文路径打印的编码痛点,实用性强
  • 提供完整的端到端打印流程,包含文件验证和打印机选择
触发精准85/100

待提升项

  • 触发词覆盖不全 原报告严重程度:轻微

    当前触发词仅包含'print an image/file'和'printing something on Windows',缺少中文场景下的常见表达如'打印图片'、'打印照片'等

    改进建议:建议补充中文触发词如'打印图片'、'打印照片'、'打印文件'等,提升中文用户触发准确率

亮点

  • 触发词边界清晰,能有效区分打印相关需求
结构规范90/100

亮点

  • Phase划分清晰,包含确认、查询、执行完整流程
  • 提供具体示例和常见陷阱说明,提升用户体验
  • frontmatter完整,文档结构规范
执行可靠88/100

亮点

  • 工具来源明确(mspaint),参数使用正确
  • 覆盖主要异常场景(中文路径编码问题)
  • 提供验证机制和错误码说明
证据可验 (前四项均值)85/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。