Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Label Printer

Windows 桌面小工具:为 4×6 英寸热敏标签机(HPRT Y813BT Label 等)生成带 QR 码的出库标签。

功能

  • GUI 输入 SKU / QTY,自动补齐日期和当日流水号
  • 生成码格式 YYMMDD-NN-SKU-QTY 的 QR 码 + 人眼可读文本
  • 直接通过 Windows GDI 送图到指定打印机(无需 PDF 阅读器)
  • 每次 Preview/Print 自动归档 PDF 到 labels/,追加一行到 labels_log.csv(按 CODE 去重)

目录结构

printer/
├── label_app.py        # 主程序
├── _make_icon.py       # 生成多尺寸 app.ico 的脚本
├── _sample.py          # 生成 sample.pdf 看排版(临时)
├── _styles.py          # 3 种风格样本(临时)
├── app.ico             # 多尺寸应用图标(16~256)
├── SOP.md              # 给一线用户的操作手册
└── dist/LabelPrinter.exe  # 打包后的可执行文件

本地运行

需要 Python 3.11+(开发环境是 3.14)。

pip install reportlab qrcode pywin32 Pillow pymupdf pyinstaller
python label_app.py

打包 exe

pyinstaller --noconfirm --onefile --windowed \
  --name LabelPrinter --icon app.ico --add-data "app.ico;." \
  label_app.py

产物在 dist/LabelPrinter.exe(约 43MB,单文件)。

部署注意

  • 不要放在 C:\Program Files\ 等需要管理员权限的目录,会导致 labels/labels_log.csv 无法写入
  • 推荐位置:桌面 / D:\tools\ / 共享文件夹
  • labels_log.csv 被 Excel 打开时会锁住,弹 Permission denied 提示 —— 关 Excel 再打印即可

用户文档

SOP.md

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages