Doesn't anybody write to paper anymore?

Alex cut_me_out at hotmail.com
Thu Apr 13 13:58:01 EDT 2000


> I would like to pass it into the queue.  IO redirection in the shell
> is ugly and awkward.

I don't know whether this counts as ugly and awkward IO redirection, but
perhaps you could do something like this:

from os import popen
printer = popen ('lpr')
printer.write("page 1\n\r\f")
printer.write("page 2\n\r\f")
printer.close ()

I actually tried "echo 'test' | lpr -" on a hunch before I read the man
page.  You might try that instead if 'lpr' by itself doesn't work.

Alex.



More information about the Python-list mailing list