Doesn't anybody write to paper anymore?

Albert Wagner alwagner at
Thu Apr 13 13:03:48 EDT 2000

I've searched the docs and my "Learning Python" book and I can't find
anything on printing to a real printer.  Through trial and error I
finally made the following work:

printer = open('/dev/lp0', 'w')
printer.write("page 1\n\r\f")
printer.write("page 2\n\r\f")

But it writes directly to the printer port.  I would like to pass it
into the queue.  IO redirection in the shell is ugly and awkward.  Also,
assigning "printer" to "os.stdout" does not work.  Someone please help a
Small is Beautiful

More information about the Python-list mailing list