Doesn't anybody write to paper anymore?
effbot at telia.com
Thu Apr 13 14:00:57 EDT 2000
Albert Wagner <alwagner at tcac.net> wrote:
> 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")
oh, you're on unix...
this might work:
printer = os.popen("lpr", "w")
for more information, read the OS documentation for
lpr and friends.
More information about the Python-list