Doesn't anybody write to paper anymore?

Albert Wagner alwagner at tcac.net
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")
printer.close

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
newbie.
-- 
Small is Beautiful



More information about the Python-list mailing list