[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: Printing
From:       "Fredrik Lundh" <fredrik () pythonware ! com>
Date:       2004-12-21 7:58:38
Message-ID: cq8l3c$viq$1 () sea ! gmane ! org
[Download RAW message or body]

Jim & Joanne Collins wrote:

> I've completed a semester of computer programming in Python
> and one thing we didn't learn was how to send data to a windows
> printer instead of the screen.  I've also asked this question in one
> of the Python help places and received about three responses.
> None of them worked.

since you didn't tell us what responses you've always gotten, I guess
I have to provide more than three...

- write directly to the printer device (PRN, LPT1)

- write the output to a temporary file, and use the "print" command
to send it to the printer

    out = open("temp.out", "w")
    ...
    out.close()
    os.system("print /D:LPT1 temp.out")

- use the win32 extensions, and talk to the GDI and spooler functions (see
  Windows API documentation for details).

- use a printer aware UI toolkit, and draw on the printer instead of the screen

- use ReportLab or any other PDF-generating toolkit, and use Acrobat to
  print it.  (same as the second alternative, but generates nicer output):

    os.system("start acrord32.exe /t /h temp.pdf printer")

if you try any of these and it doesn't work, let us know which one, and
what happened.

</F> 



-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic