Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #85732
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Subject | Re: Printing to printer, windows 7 |
| Date | 2015-02-17 00:50 -0500 |
| Organization | IISS Elusive Unicorn |
| References | <c4b69693-c5fa-4c89-b4ab-a7a1fe898c22@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.18780.1424152259.18130.python-list@python.org> (permalink) |
On Mon, 16 Feb 2015 18:08:22 -0800 (PST), ken.hessel@gmail.com declaimed
the following:
>Would seem to be a simple problem. I just want to print to my printer instead of the console using Python 2.7, Windows 7. Hours of looking through FAQ's and Google haven't yielded a solution. Any suggestions appreciated --
It hasn't been easy since W9x...
Windows printers aren't considered text output devices; one has to
basically create a graphical image of the page and send the image to the
printer driver. That means lots of win32 function calls on graphical
contexts, rendering, etc.
Simplest is to just write to a scratch/temp text file, and invoke some
utility to do the printing. I used to know how to invoke Word to
start/print/exit...
... Just tested
C:\Users\Wulfraed\Documents>notepad /p test.csv
C:\Users\Wulfraed\Documents>
did print the file (but put a header line of the file name at the top --
might be an option to suppress that). Other programs may respond to a /p as
a command to print the file. (Appears SciTE takes it, different header and
footer -- the SciTE help says it is -p to print the file)
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Printing to printer, windows 7 ken.hessel@gmail.com - 2015-02-16 18:08 -0800 Re: Printing to printer, windows 7 Dave Angel <davea@davea.name> - 2015-02-16 22:02 -0500 Re: Printing to printer, windows 7 Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-02-17 00:50 -0500 Re: Printing to printer, windows 7 sjmsoft@gmail.com - 2015-02-17 12:10 -0800 Re: Printing to printer, windows 7 Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-02-17 20:41 -0500 Re: Printing to printer, windows 7 sohcahtoa82@gmail.com - 2015-02-17 17:59 -0800 Re: Printing to printer, windows 7 MRAB <python@mrabarnett.plus.com> - 2015-02-18 02:11 +0000
csiph-web