Python - 如何使用 DYMO 标签打印机打印条形码

问题描述 投票:0回答:0

以下是我使用的代码,它抛出了以下错误。我已经搜索并搜索了答案,但到目前为止,我所找到的都没有解决我的问题。

我有一台Dymo LabelWriter 550。我安装了LabelWriter v8软件,安装了Dymo Connect软件,安装了DYMO Label V.8 SDK框架。

我还为我的 IDE 安装了 PyCharm。

守则-

import requests
from win32com.client import Dispatch
import pathlib

url = 'https://www.nuget.org/packages/DYMO.Connect.SDK/'
response = requests.get(url)
print(response.content)

barcode_val = '99903930'

barcode_path = pathlib.Path('./my.label')
my_printer = 'DYMO LabelWriter 550'

printer_com = Dispatch('Dymo.DymoAddIn')
printer_com.SelectPrinter(my_printer)
printer_com.Open(barcode_path)

printer_label = Dispatch('Dymo.DymoLabels')
printer_label.SetField('Barcode', barcode_val)

printer_com.StartPrintJob()
printer_com.Print(1, False)
`printer_com.EndPrintJob``

错误

I have attached a screenshot of the full message.

据我所知,没有太多 Python 支持专门针对我正在尝试做的事情,即打印到 Dymo 打印机以确保我可以从 Python 打印,然后转向从扫描仪或任何输入方法或从服务打印现在。

现在,我只想从 Python 脚本打印。这是一个测试阶段,看看我们是否可以使用 Python 打印到 Dymo LabelWriter。

我们做了什么视频https://www.youtube.com/watch?v=trKAtdVjAus

  • 我确认我们的安装路径在所有安装过程中都是相同的,使用相同的 IDE 等。但是我们继续遇到这些错误。

然后我们开始使用其他网站的其他资源来拼凑东西。

python label dymo
© www.soinside.com 2019 - 2024. All rights reserved.