[Tutor] Something new in line printing?

David Lowry-Duda david at lowryduda.com
Mon Nov 11 18:43:51 EST 2019


Hello!

> I acquired a new printer, a HP OfficeJet 4652. Ran a program to print 
> the output of a program and get the following error:
> 
> lpr: Error - No default destination.

lpr is not a python program. It is a protocol, often used through a tool 
(which is often written in C). Not every printer follows the LPD/LPR 
protocol.

> pr = (os.popen("lpr", "w"))
> pr.write (datecode)
> pr.close()

In your code, these lines open "lpr" as a process and writes some things 
to it. The first step towards debugging your printing would probably be 
to remove python and see if you can directly setup/use lpr from a 
command-line.

Good luck!

-- 
David Lowry-Duda <david at lowryduda.com> <davidlowryduda.com>


More information about the Tutor mailing list