【问题标题】:Print using Brother QL-800 printer with raspberry pi使用带有树莓派的 Brother QL-800 打印机进行打印
【发布时间】:2021-11-17 08:33:02
【问题描述】:

我正在尝试使用树莓派从 python 代码中打印。

我尝试使用 Brother-ql 模块,但它没有给我错误。 但是,打印机不打印任何东西。

这是我的代码及其给出的结果的快照。 enter image description here

有什么建议吗? 我已经在图片中发布了编码

【问题讨论】:

  • 我有几个兄弟打印机的例子,但它并没有被证明是最好的选择,我建议使用斑马打印机。如果你已经要使用兄弟,那么通过 CUPS 简单地打印 os.system("lp - printer document") 等。
  • 我试过了,但它只是不打印,但我设法弄明白了。还是谢谢!
  • 最好在此处提供代码和错误消息,而不是提供图像。如果您编辑和更新您的帖子会很棒
  • 请使用像code这样的正确代码格式,并避免使用图像来提供代码和调试细节。仅使用图像显示非控制台输出结果。

标签: python printing raspberry-pi


【解决方案1】:

我设法使用带有 Raspberry Pi 的 Brother QL-800 打印机进行打印。

我使用python中的cups模块进行打印。



import cups

conn = cups.Connection()

printers = conn.getPrinters()

printer_name = (printers.keys())[0]

#desired location of file to read

conn.printFile(printer_name, '/home/pi/Desktop/whatsup.csv',"",{})

【讨论】:

  • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
猜你喜欢
  • 2019-08-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多